{"action":"created","comment":{"url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/comments/64613988","id":64613988,"diff_hunk":"@@ -0,0 +1,72 @@\n+require 'memoist'\n+module Tapjoy\n+  module LDAP\n+    module API\n+      module Group\n+        class << self\n+          extend Memoist\n+          def create(group_name, group_type)\n+            Tapjoy::LDAP::client.add(\n+              distinguished_name(group_name),\n+              ldap_attr(group_name, group_type)\n+            )\n+          end\n+\n+          def destroy(group_name)\n+            Tapjoy::LDAP::client.delete(distinguished_name(group_name))\n+          end\n+\n+          def update(group_name, username, operation)\n+            Tapjoy::LDAP::client.modify(\n+              distinguished_name(group_name),\n+              [[operation, :memberUid, username]]\n+            )\n+          end\n+\n+          def index\n+            Tapjoy::LDAP::client.search('*', filter(objectClass: 'posixGroup'))\n+          end\n+\n+          # Lookup GID for the given group\n+          def lookup_id(groupname)\n+            gidnumber = []\n+\n+            oc_filter = Net::LDAP::Filter.eq('objectclass', 'posixGroup')\n+            cn_filter = Net::LDAP::Filter.eq('cn', groupname)\n+            filter    = Net::LDAP::Filter.join(oc_filter, cn_filter)\n+\n+            results = Tapjoy::LDAP::client.search(['gidNumber'], filter)","path":"lib/tapjoy/ldap/api/group.rb","position":38,"original_position":38,"commit_id":"f94a0692df05ae3ceca19388a3b012452a2d17e4","original_commit_id":"f94a0692df05ae3ceca19388a3b012452a2d17e4","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":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Do not use `::` for method calls.](https://www.codacy.com/app/ali-tayarani/ldap_tools/file/2633306012/issues/source?bid=3316970&fileBranchId=3318857#l38)","created_at":"2016-05-25T17:16:49Z","updated_at":"2016-05-25T17:16:49Z","html_url":"https://github.com/Tapjoy/ldap_tools/pull/16#discussion_r64613988","pull_request_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/comments/64613988"},"html":{"href":"https://github.com/Tapjoy/ldap_tools/pull/16#discussion_r64613988"},"pull_request":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/16","id":71429295,"html_url":"https://github.com/Tapjoy/ldap_tools/pull/16","diff_url":"https://github.com/Tapjoy/ldap_tools/pull/16.diff","patch_url":"https://github.com/Tapjoy/ldap_tools/pull/16.patch","issue_url":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/16","number":16,"state":"open","locked":false,"title":"first pass at group API","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":"WIP","created_at":"2016-05-25T17:14:15Z","updated_at":"2016-05-25T17:16:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d885a836d53eadbf710324b1d0a0c62bcc6ed20a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/16/commits","review_comments_url":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/16/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/16/comments","statuses_url":"https://api.github.com/repos/Tapjoy/ldap_tools/statuses/f94a0692df05ae3ceca19388a3b012452a2d17e4","head":{"label":"Tapjoy:feature/self_service","ref":"feature/self_service","sha":"f94a0692df05ae3ceca19388a3b012452a2d17e4","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}","deployments_url":"https://api.github.com/repos/Tapjoy/ldap_tools/deployments","created_at":"2015-02-13T20:16:31Z","updated_at":"2016-01-12T18:08:28Z","pushed_at":"2016-05-25T17:14:15Z","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":68,"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":"993bdb3b516fb0d42e9f0c37e221565f2ce3c88b","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}","deployments_url":"https://api.github.com/repos/Tapjoy/ldap_tools/deployments","created_at":"2015-02-13T20:16:31Z","updated_at":"2016-01-12T18:08:28Z","pushed_at":"2016-05-25T17:14:15Z","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":68,"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/16"},"html":{"href":"https://github.com/Tapjoy/ldap_tools/pull/16"},"issue":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/16"},"comments":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/pulls/16/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/16/commits"},"statuses":{"href":"https://api.github.com/repos/Tapjoy/ldap_tools/statuses/f94a0692df05ae3ceca19388a3b012452a2d17e4"}}}}
{"actor":{"display_login":"atayarani"}}