{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/trevoro/sshauth/pulls/4","id":69958437,"html_url":"https://github.com/trevoro/sshauth/pull/4","diff_url":"https://github.com/trevoro/sshauth/pull/4.diff","patch_url":"https://github.com/trevoro/sshauth/pull/4.patch","issue_url":"https://api.github.com/repos/trevoro/sshauth/issues/4","number":4,"state":"open","locked":false,"title":"Support team ID or name in config.json (issue-3)","user":{"login":"brycefisher","id":220106,"avatar_url":"https://avatars.githubusercontent.com/u/220106?v=3","gravatar_id":"","url":"https://api.github.com/users/brycefisher","html_url":"https://github.com/brycefisher","followers_url":"https://api.github.com/users/brycefisher/followers","following_url":"https://api.github.com/users/brycefisher/following{/other_user}","gists_url":"https://api.github.com/users/brycefisher/gists{/gist_id}","starred_url":"https://api.github.com/users/brycefisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brycefisher/subscriptions","organizations_url":"https://api.github.com/users/brycefisher/orgs","repos_url":"https://api.github.com/users/brycefisher/repos","events_url":"https://api.github.com/users/brycefisher/events{/privacy}","received_events_url":"https://api.github.com/users/brycefisher/received_events","type":"User","site_admin":false},"body":"See https://github.com/trevoro/sshauth/issues/3\r\n\r\nThis feature allows a user to provide either the `team` name (just as before) or `team_id` (brand new) in the config.json file. When using only the team name, sshauth will break if the name of the team changes. By using the team ID, sshauth is more resilient to changes.\r\n\r\nAnother bonus to the resiliency is that in organizations with multiple teams, one fewer API call is made to retrieve the team members per ssh connection; so using a team ID could enable more ssh connections before hitting the Github API rate limits.\r\n\r\nThis feature is fully backwards compatible. Here's an example of the new config.json style:\r\n\r\n```json\r\n{\r\n  \"owner\": \"coreos\",\r\n  \"token\": \"super-duper-secret-oauth-token-here\",\r\n  \"team_id\": 123456\r\n}\r\n```\r\n\r\n**Note that `team_id` must be an `int` not a string.**\r\n\r\nFor a given organization `foo`, to retrieve the ID of a team from the Github API that you are a part of:\r\n\r\n```bash\r\n$ curl -u brycefisher:mypassword https://api.github.com/orgs/foo/teams\r\n[\r\n  {\r\n    \"name\": \"Team Awesome Sauce\",\r\n    \"id\": 2021031,\r\n    \"slug\": \"team-awesome-sauce\",\r\n    \"description\": \"This team rocks!\",\r\n    \"permission\": \"pull\",\r\n    \"privacy\": \"closed\",\r\n    \"url\": \"https://api.github.com/teams/2021031\",\r\n    \"members_url\": \"https://api.github.com/teams/2021031/members{/member}\",\r\n    \"repositories_url\": \"https://api.github.com/teams/2021031/repos\"\r\n  }\r\n]\r\n```\r\n\r\nI'd also tried to make my changes in a purely additive way to avoid breakage for users of this tool. Specifically, I added a new method `Github.GetTeamMembersByID()` rather than change the behavior or method signature of `GithubClient.GetTeamMembers()` since the latter is a public method and could in theory be used by other packages.","created_at":"2016-05-13T08:16:14Z","updated_at":"2016-05-13T08:16:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/trevoro/sshauth/pulls/4/commits","review_comments_url":"https://api.github.com/repos/trevoro/sshauth/pulls/4/comments","review_comment_url":"https://api.github.com/repos/trevoro/sshauth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trevoro/sshauth/issues/4/comments","statuses_url":"https://api.github.com/repos/trevoro/sshauth/statuses/fbf336d1fde463644f7c0163480750c176de98de","head":{"label":"brycefisher:issue-3-team-id-config","ref":"issue-3-team-id-config","sha":"fbf336d1fde463644f7c0163480750c176de98de","user":{"login":"brycefisher","id":220106,"avatar_url":"https://avatars.githubusercontent.com/u/220106?v=3","gravatar_id":"","url":"https://api.github.com/users/brycefisher","html_url":"https://github.com/brycefisher","followers_url":"https://api.github.com/users/brycefisher/followers","following_url":"https://api.github.com/users/brycefisher/following{/other_user}","gists_url":"https://api.github.com/users/brycefisher/gists{/gist_id}","starred_url":"https://api.github.com/users/brycefisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brycefisher/subscriptions","organizations_url":"https://api.github.com/users/brycefisher/orgs","repos_url":"https://api.github.com/users/brycefisher/repos","events_url":"https://api.github.com/users/brycefisher/events{/privacy}","received_events_url":"https://api.github.com/users/brycefisher/received_events","type":"User","site_admin":false},"repo":{"id":58685584,"name":"sshauth","full_name":"brycefisher/sshauth","owner":{"login":"brycefisher","id":220106,"avatar_url":"https://avatars.githubusercontent.com/u/220106?v=3","gravatar_id":"","url":"https://api.github.com/users/brycefisher","html_url":"https://github.com/brycefisher","followers_url":"https://api.github.com/users/brycefisher/followers","following_url":"https://api.github.com/users/brycefisher/following{/other_user}","gists_url":"https://api.github.com/users/brycefisher/gists{/gist_id}","starred_url":"https://api.github.com/users/brycefisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brycefisher/subscriptions","organizations_url":"https://api.github.com/users/brycefisher/orgs","repos_url":"https://api.github.com/users/brycefisher/repos","events_url":"https://api.github.com/users/brycefisher/events{/privacy}","received_events_url":"https://api.github.com/users/brycefisher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brycefisher/sshauth","description":"SSH Authentication using the Github Teams API","fork":true,"url":"https://api.github.com/repos/brycefisher/sshauth","forks_url":"https://api.github.com/repos/brycefisher/sshauth/forks","keys_url":"https://api.github.com/repos/brycefisher/sshauth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brycefisher/sshauth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brycefisher/sshauth/teams","hooks_url":"https://api.github.com/repos/brycefisher/sshauth/hooks","issue_events_url":"https://api.github.com/repos/brycefisher/sshauth/issues/events{/number}","events_url":"https://api.github.com/repos/brycefisher/sshauth/events","assignees_url":"https://api.github.com/repos/brycefisher/sshauth/assignees{/user}","branches_url":"https://api.github.com/repos/brycefisher/sshauth/branches{/branch}","tags_url":"https://api.github.com/repos/brycefisher/sshauth/tags","blobs_url":"https://api.github.com/repos/brycefisher/sshauth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brycefisher/sshauth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brycefisher/sshauth/git/refs{/sha}","trees_url":"https://api.github.com/repos/brycefisher/sshauth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brycefisher/sshauth/statuses/{sha}","languages_url":"https://api.github.com/repos/brycefisher/sshauth/languages","stargazers_url":"https://api.github.com/repos/brycefisher/sshauth/stargazers","contributors_url":"https://api.github.com/repos/brycefisher/sshauth/contributors","subscribers_url":"https://api.github.com/repos/brycefisher/sshauth/subscribers","subscription_url":"https://api.github.com/repos/brycefisher/sshauth/subscription","commits_url":"https://api.github.com/repos/brycefisher/sshauth/commits{/sha}","git_commits_url":"https://api.github.com/repos/brycefisher/sshauth/git/commits{/sha}","comments_url":"https://api.github.com/repos/brycefisher/sshauth/comments{/number}","issue_comment_url":"https://api.github.com/repos/brycefisher/sshauth/issues/comments{/number}","contents_url":"https://api.github.com/repos/brycefisher/sshauth/contents/{+path}","compare_url":"https://api.github.com/repos/brycefisher/sshauth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brycefisher/sshauth/merges","archive_url":"https://api.github.com/repos/brycefisher/sshauth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brycefisher/sshauth/downloads","issues_url":"https://api.github.com/repos/brycefisher/sshauth/issues{/number}","pulls_url":"https://api.github.com/repos/brycefisher/sshauth/pulls{/number}","milestones_url":"https://api.github.com/repos/brycefisher/sshauth/milestones{/number}","notifications_url":"https://api.github.com/repos/brycefisher/sshauth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brycefisher/sshauth/labels{/name}","releases_url":"https://api.github.com/repos/brycefisher/sshauth/releases{/id}","deployments_url":"https://api.github.com/repos/brycefisher/sshauth/deployments","created_at":"2016-05-13T00:05:58Z","updated_at":"2016-05-13T00:06:00Z","pushed_at":"2016-05-13T08:01:39Z","git_url":"git://github.com/brycefisher/sshauth.git","ssh_url":"git@github.com:brycefisher/sshauth.git","clone_url":"https://github.com/brycefisher/sshauth.git","svn_url":"https://github.com/brycefisher/sshauth","homepage":"","size":8,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"trevoro:master","ref":"master","sha":"3cbf5d6fd26e491f4bf7160cc4fb8f25b638de78","user":{"login":"trevoro","id":20488,"avatar_url":"https://avatars.githubusercontent.com/u/20488?v=3","gravatar_id":"","url":"https://api.github.com/users/trevoro","html_url":"https://github.com/trevoro","followers_url":"https://api.github.com/users/trevoro/followers","following_url":"https://api.github.com/users/trevoro/following{/other_user}","gists_url":"https://api.github.com/users/trevoro/gists{/gist_id}","starred_url":"https://api.github.com/users/trevoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevoro/subscriptions","organizations_url":"https://api.github.com/users/trevoro/orgs","repos_url":"https://api.github.com/users/trevoro/repos","events_url":"https://api.github.com/users/trevoro/events{/privacy}","received_events_url":"https://api.github.com/users/trevoro/received_events","type":"User","site_admin":false},"repo":{"id":33386273,"name":"sshauth","full_name":"trevoro/sshauth","owner":{"login":"trevoro","id":20488,"avatar_url":"https://avatars.githubusercontent.com/u/20488?v=3","gravatar_id":"","url":"https://api.github.com/users/trevoro","html_url":"https://github.com/trevoro","followers_url":"https://api.github.com/users/trevoro/followers","following_url":"https://api.github.com/users/trevoro/following{/other_user}","gists_url":"https://api.github.com/users/trevoro/gists{/gist_id}","starred_url":"https://api.github.com/users/trevoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevoro/subscriptions","organizations_url":"https://api.github.com/users/trevoro/orgs","repos_url":"https://api.github.com/users/trevoro/repos","events_url":"https://api.github.com/users/trevoro/events{/privacy}","received_events_url":"https://api.github.com/users/trevoro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trevoro/sshauth","description":"SSH Authentication using the Github Teams API","fork":false,"url":"https://api.github.com/repos/trevoro/sshauth","forks_url":"https://api.github.com/repos/trevoro/sshauth/forks","keys_url":"https://api.github.com/repos/trevoro/sshauth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trevoro/sshauth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trevoro/sshauth/teams","hooks_url":"https://api.github.com/repos/trevoro/sshauth/hooks","issue_events_url":"https://api.github.com/repos/trevoro/sshauth/issues/events{/number}","events_url":"https://api.github.com/repos/trevoro/sshauth/events","assignees_url":"https://api.github.com/repos/trevoro/sshauth/assignees{/user}","branches_url":"https://api.github.com/repos/trevoro/sshauth/branches{/branch}","tags_url":"https://api.github.com/repos/trevoro/sshauth/tags","blobs_url":"https://api.github.com/repos/trevoro/sshauth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trevoro/sshauth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trevoro/sshauth/git/refs{/sha}","trees_url":"https://api.github.com/repos/trevoro/sshauth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trevoro/sshauth/statuses/{sha}","languages_url":"https://api.github.com/repos/trevoro/sshauth/languages","stargazers_url":"https://api.github.com/repos/trevoro/sshauth/stargazers","contributors_url":"https://api.github.com/repos/trevoro/sshauth/contributors","subscribers_url":"https://api.github.com/repos/trevoro/sshauth/subscribers","subscription_url":"https://api.github.com/repos/trevoro/sshauth/subscription","commits_url":"https://api.github.com/repos/trevoro/sshauth/commits{/sha}","git_commits_url":"https://api.github.com/repos/trevoro/sshauth/git/commits{/sha}","comments_url":"https://api.github.com/repos/trevoro/sshauth/comments{/number}","issue_comment_url":"https://api.github.com/repos/trevoro/sshauth/issues/comments{/number}","contents_url":"https://api.github.com/repos/trevoro/sshauth/contents/{+path}","compare_url":"https://api.github.com/repos/trevoro/sshauth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trevoro/sshauth/merges","archive_url":"https://api.github.com/repos/trevoro/sshauth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trevoro/sshauth/downloads","issues_url":"https://api.github.com/repos/trevoro/sshauth/issues{/number}","pulls_url":"https://api.github.com/repos/trevoro/sshauth/pulls{/number}","milestones_url":"https://api.github.com/repos/trevoro/sshauth/milestones{/number}","notifications_url":"https://api.github.com/repos/trevoro/sshauth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trevoro/sshauth/labels{/name}","releases_url":"https://api.github.com/repos/trevoro/sshauth/releases{/id}","deployments_url":"https://api.github.com/repos/trevoro/sshauth/deployments","created_at":"2015-04-03T22:46:17Z","updated_at":"2016-03-14T16:29:51Z","pushed_at":"2015-04-18T19:13:31Z","git_url":"git://github.com/trevoro/sshauth.git","ssh_url":"git@github.com:trevoro/sshauth.git","clone_url":"https://github.com/trevoro/sshauth.git","svn_url":"https://github.com/trevoro/sshauth","homepage":"","size":161,"stargazers_count":67,"watchers_count":67,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trevoro/sshauth/pulls/4"},"html":{"href":"https://github.com/trevoro/sshauth/pull/4"},"issue":{"href":"https://api.github.com/repos/trevoro/sshauth/issues/4"},"comments":{"href":"https://api.github.com/repos/trevoro/sshauth/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/trevoro/sshauth/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/trevoro/sshauth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trevoro/sshauth/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/trevoro/sshauth/statuses/fbf336d1fde463644f7c0163480750c176de98de"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":25,"deletions":5,"changed_files":2}}