{"action":"created","comment":{"url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/comments/49214353","id":49214353,"diff_hunk":"@@ -0,0 +1,46 @@\n+module Tapjoy\n+  module LDAP\n+    module Key\n+      # Install key on localhost\n+      class Install\n+        def install\n+          Tapjoy::LDAP::Key.get_keys_from_ldap.each do |user, values|\n+            directory = directory(user)\n+            FileUtils.mkdir_p(directory) unless File.exists?directory\n+            authorized_keys_file = \"#{directory}/authorized_keys\"\n+            keys = load_keys_from_file(authorized_keys_file)\n+            insert_keys(authorized_keys_file, keys, values)\n+          end\n+        end\n+\n+        private\n+        def opts\n+          @opts ||= Trollop::options do\n+              # Set help message\n+              usage 'key install [options]'","path":"lib/tapjoy/ldap/key/install.rb","position":20,"original_position":20,"commit_id":"1569fe5b18b0a88ee8925e96cc8078b0105f0bb4","original_commit_id":"1569fe5b18b0a88ee8925e96cc8078b0105f0bb4","user":{"login":"ehealy","id":2730792,"avatar_url":"https://avatars.githubusercontent.com/u/2730792?v=3","gravatar_id":"","url":"https://api.github.com/users/ehealy","html_url":"https://github.com/ehealy","followers_url":"https://api.github.com/users/ehealy/followers","following_url":"https://api.github.com/users/ehealy/following{/other_user}","gists_url":"https://api.github.com/users/ehealy/gists{/gist_id}","starred_url":"https://api.github.com/users/ehealy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehealy/subscriptions","organizations_url":"https://api.github.com/users/ehealy/orgs","repos_url":"https://api.github.com/users/ehealy/repos","events_url":"https://api.github.com/users/ehealy/events{/privacy}","received_events_url":"https://api.github.com/users/ehealy/received_events","type":"User","site_admin":false},"body":"actually do we want to add an optional user option here so we don't have to install all the ldap keys on localhost when this is run? I can see the use for downloading all the keys during a bootstrap operation, but we may have cases where we don't want all the keys.  This is more food for thought than something that would have to be part of the scope of this pr. ","created_at":"2016-01-08T17:32:59Z","updated_at":"2016-01-08T17:32:59Z","html_url":"https://github.com/Tapjoy/ldap_tools/pull/8#discussion_r49214353","pull_request_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/comments/49214353"},"html":{"href":"https://github.com/Tapjoy/ldap_tools/pull/8#discussion_r49214353"},"pull_request":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8","id":53629313,"html_url":"https://github.com/Tapjoy/ldap_tools/pull/8","diff_url":"https://github.com/Tapjoy/ldap_tools/pull/8.diff","patch_url":"https://github.com/Tapjoy/ldap_tools/pull/8.patch","issue_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/8","number":8,"state":"open","locked":false,"title":"V060","user":{"login":"atayarani","id":619512,"avatar_url":"https://avatars.githubusercontent.com/u/619512?v=3","gravatar_id":"","url":"https://api.github.com/users/atayarani","html_url":"https://github.com/atayarani","followers_url":"https://api.github.com/users/atayarani/followers","following_url":"https://api.github.com/users/atayarani/following{/other_user}","gists_url":"https://api.github.com/users/atayarani/gists{/gist_id}","starred_url":"https://api.github.com/users/atayarani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atayarani/subscriptions","organizations_url":"https://api.github.com/users/atayarani/orgs","repos_url":"https://api.github.com/users/atayarani/repos","events_url":"https://api.github.com/users/atayarani/events{/privacy}","received_events_url":"https://api.github.com/users/atayarani/received_events","type":"User","site_admin":false},"body":"@Tapjoy/eng-group-ops \r\n\r\nNotes:\r\n* removed audit stuff, because it's not applicable in this version.  It will return in 0.7.0","created_at":"2015-12-14T22:08:12Z","updated_at":"2016-01-08T17:32:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4923693618cf9482e06cbf459111c0328267496d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8/commits","review_comments_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8/comments","review_comment_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/8/comments","statuses_url":"https://api.github.com/repos/Tapjoy/ldap_tools/statuses/1569fe5b18b0a88ee8925e96cc8078b0105f0bb4","head":{"label":"Tapjoy:v060","ref":"v060","sha":"1569fe5b18b0a88ee8925e96cc8078b0105f0bb4","user":{"login":"Tapjoy","id":716849,"avatar_url":"https://avatars.githubusercontent.com/u/716849?v=3","gravatar_id":"","url":"https://api.github.com/users/Tapjoy","html_url":"https://github.com/Tapjoy","followers_url":"https://api.github.com/users/Tapjoy/followers","following_url":"https://api.github.com/users/Tapjoy/following{/other_user}","gists_url":"https://api.github.com/users/Tapjoy/gists{/gist_id}","starred_url":"https://api.github.com/users/Tapjoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tapjoy/subscriptions","organizations_url":"https://api.github.com/users/Tapjoy/orgs","repos_url":"https://api.github.com/users/Tapjoy/repos","events_url":"https://api.github.com/users/Tapjoy/events{/privacy}","received_events_url":"https://api.github.com/users/Tapjoy/received_events","type":"Organization","site_admin":false},"repo":{"id":30774243,"name":"ldap_tools","full_name":"Tapjoy/ldap_tools","owner":{"login":"Tapjoy","id":716849,"avatar_url":"https://avatars.githubusercontent.com/u/716849?v=3","gravatar_id":"","url":"https://api.github.com/users/Tapjoy","html_url":"https://github.com/Tapjoy","followers_url":"https://api.github.com/users/Tapjoy/followers","following_url":"https://api.github.com/users/Tapjoy/following{/other_user}","gists_url":"https://api.github.com/users/Tapjoy/gists{/gist_id}","starred_url":"https://api.github.com/users/Tapjoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tapjoy/subscriptions","organizations_url":"https://api.github.com/users/Tapjoy/orgs","repos_url":"https://api.github.com/users/Tapjoy/repos","events_url":"https://api.github.com/users/Tapjoy/events{/privacy}","received_events_url":"https://api.github.com/users/Tapjoy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tapjoy/ldap_tools","description":"Utilities to assist with the management of LDAP resources","fork":false,"url":"https://api.github.com/repos/Tapjoy/ldap_tools","forks_url":"https://api.github.com/repos/Tapjoy/ldap_tools/forks","keys_url":"https://api.github.com/repos/Tapjoy/ldap_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tapjoy/ldap_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tapjoy/ldap_tools/teams","hooks_url":"https://api.github.com/repos/Tapjoy/ldap_tools/hooks","issue_events_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/events{/number}","events_url":"https://api.github.com/repos/Tapjoy/ldap_tools/events","assignees_url":"https://api.github.com/repos/Tapjoy/ldap_tools/assignees{/user}","branches_url":"https://api.github.com/repos/Tapjoy/ldap_tools/branches{/branch}","tags_url":"https://api.github.com/repos/Tapjoy/ldap_tools/tags","blobs_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tapjoy/ldap_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/Tapjoy/ldap_tools/languages","stargazers_url":"https://api.github.com/repos/Tapjoy/ldap_tools/stargazers","contributors_url":"https://api.github.com/repos/Tapjoy/ldap_tools/contributors","subscribers_url":"https://api.github.com/repos/Tapjoy/ldap_tools/subscribers","subscription_url":"https://api.github.com/repos/Tapjoy/ldap_tools/subscription","commits_url":"https://api.github.com/repos/Tapjoy/ldap_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tapjoy/ldap_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tapjoy/ldap_tools/contents/{+path}","compare_url":"https://api.github.com/repos/Tapjoy/ldap_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tapjoy/ldap_tools/merges","archive_url":"https://api.github.com/repos/Tapjoy/ldap_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tapjoy/ldap_tools/downloads","issues_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues{/number}","pulls_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/Tapjoy/ldap_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/Tapjoy/ldap_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tapjoy/ldap_tools/labels{/name}","releases_url":"https://api.github.com/repos/Tapjoy/ldap_tools/releases{/id}","created_at":"2015-02-13T20:16:31Z","updated_at":"2015-07-14T14:29:23Z","pushed_at":"2015-12-16T17:37:36Z","git_url":"git://github.com/Tapjoy/ldap_tools.git","ssh_url":"git@github.com:Tapjoy/ldap_tools.git","clone_url":"https://github.com/Tapjoy/ldap_tools.git","svn_url":"https://github.com/Tapjoy/ldap_tools","homepage":null,"size":49,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"Tapjoy:master","ref":"master","sha":"cd868b3995f89ff1b748e6143750a0b0bb5cdf00","user":{"login":"Tapjoy","id":716849,"avatar_url":"https://avatars.githubusercontent.com/u/716849?v=3","gravatar_id":"","url":"https://api.github.com/users/Tapjoy","html_url":"https://github.com/Tapjoy","followers_url":"https://api.github.com/users/Tapjoy/followers","following_url":"https://api.github.com/users/Tapjoy/following{/other_user}","gists_url":"https://api.github.com/users/Tapjoy/gists{/gist_id}","starred_url":"https://api.github.com/users/Tapjoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tapjoy/subscriptions","organizations_url":"https://api.github.com/users/Tapjoy/orgs","repos_url":"https://api.github.com/users/Tapjoy/repos","events_url":"https://api.github.com/users/Tapjoy/events{/privacy}","received_events_url":"https://api.github.com/users/Tapjoy/received_events","type":"Organization","site_admin":false},"repo":{"id":30774243,"name":"ldap_tools","full_name":"Tapjoy/ldap_tools","owner":{"login":"Tapjoy","id":716849,"avatar_url":"https://avatars.githubusercontent.com/u/716849?v=3","gravatar_id":"","url":"https://api.github.com/users/Tapjoy","html_url":"https://github.com/Tapjoy","followers_url":"https://api.github.com/users/Tapjoy/followers","following_url":"https://api.github.com/users/Tapjoy/following{/other_user}","gists_url":"https://api.github.com/users/Tapjoy/gists{/gist_id}","starred_url":"https://api.github.com/users/Tapjoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tapjoy/subscriptions","organizations_url":"https://api.github.com/users/Tapjoy/orgs","repos_url":"https://api.github.com/users/Tapjoy/repos","events_url":"https://api.github.com/users/Tapjoy/events{/privacy}","received_events_url":"https://api.github.com/users/Tapjoy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tapjoy/ldap_tools","description":"Utilities to assist with the management of LDAP resources","fork":false,"url":"https://api.github.com/repos/Tapjoy/ldap_tools","forks_url":"https://api.github.com/repos/Tapjoy/ldap_tools/forks","keys_url":"https://api.github.com/repos/Tapjoy/ldap_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tapjoy/ldap_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tapjoy/ldap_tools/teams","hooks_url":"https://api.github.com/repos/Tapjoy/ldap_tools/hooks","issue_events_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/events{/number}","events_url":"https://api.github.com/repos/Tapjoy/ldap_tools/events","assignees_url":"https://api.github.com/repos/Tapjoy/ldap_tools/assignees{/user}","branches_url":"https://api.github.com/repos/Tapjoy/ldap_tools/branches{/branch}","tags_url":"https://api.github.com/repos/Tapjoy/ldap_tools/tags","blobs_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tapjoy/ldap_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/Tapjoy/ldap_tools/languages","stargazers_url":"https://api.github.com/repos/Tapjoy/ldap_tools/stargazers","contributors_url":"https://api.github.com/repos/Tapjoy/ldap_tools/contributors","subscribers_url":"https://api.github.com/repos/Tapjoy/ldap_tools/subscribers","subscription_url":"https://api.github.com/repos/Tapjoy/ldap_tools/subscription","commits_url":"https://api.github.com/repos/Tapjoy/ldap_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tapjoy/ldap_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tapjoy/ldap_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tapjoy/ldap_tools/contents/{+path}","compare_url":"https://api.github.com/repos/Tapjoy/ldap_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tapjoy/ldap_tools/merges","archive_url":"https://api.github.com/repos/Tapjoy/ldap_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tapjoy/ldap_tools/downloads","issues_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues{/number}","pulls_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/Tapjoy/ldap_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/Tapjoy/ldap_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tapjoy/ldap_tools/labels{/name}","releases_url":"https://api.github.com/repos/Tapjoy/ldap_tools/releases{/id}","created_at":"2015-02-13T20:16:31Z","updated_at":"2015-07-14T14:29:23Z","pushed_at":"2015-12-16T17:37:36Z","git_url":"git://github.com/Tapjoy/ldap_tools.git","ssh_url":"git@github.com:Tapjoy/ldap_tools.git","clone_url":"https://github.com/Tapjoy/ldap_tools.git","svn_url":"https://github.com/Tapjoy/ldap_tools","homepage":null,"size":49,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8"},"html":{"href":"https://github.com/Tapjoy/ldap_tools/pull/8"},"issue":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/8"},"comments":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/statuses/1569fe5b18b0a88ee8925e96cc8078b0105f0bb4"}}}}