{"action":"created","comment":{"url":"https://api.github.com/repos/bhearsum/bzrest/pulls/comments/26946470","id":26946470,"diff_hunk":"@@ -10,24 +10,42 @@\n \n \n class BugzillaClient(object):\n-    def configure(self, bzurl, username, password):\n+    def configure(self, bzurl, username=None, password=None, apikey=None):\n+        if apikey:\n+            self.apikey = apikey\n+            self.username = None\n+            self.password = None\n+        elif username and password:\n+            self.apikey = None\n+            self.username = username\n+            self.password = password\n+        else:\n+            raise ValueError(\"One of apikey or username & password must be supplied\")","path":"bzrest/client.py","position":15,"original_position":15,"commit_id":"fb9cc6c3bb2fa61791c1aadaef600ee74881ad25","original_commit_id":"fb9cc6c3bb2fa61791c1aadaef600ee74881ad25","user":{"login":"bhearsum","id":49649,"avatar_url":"https://avatars.githubusercontent.com/u/49649?v=3","gravatar_id":"","url":"https://api.github.com/users/bhearsum","html_url":"https://github.com/bhearsum","followers_url":"https://api.github.com/users/bhearsum/followers","following_url":"https://api.github.com/users/bhearsum/following{/other_user}","gists_url":"https://api.github.com/users/bhearsum/gists{/gist_id}","starred_url":"https://api.github.com/users/bhearsum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhearsum/subscriptions","organizations_url":"https://api.github.com/users/bhearsum/orgs","repos_url":"https://api.github.com/users/bhearsum/repos","events_url":"https://api.github.com/users/bhearsum/events{/privacy}","received_events_url":"https://api.github.com/users/bhearsum/received_events","type":"User","site_admin":false},"body":"Given that the service requires a restart to pick up changes, I don't see why you need support for both to upgrade gracefully. You just need to make sure the config is correct before restarting for the new code. (Maybe that's what you're getting at here - I'm not sure.)","created_at":"2015-03-23T15:25:21Z","updated_at":"2015-03-23T15:25:21Z","html_url":"https://github.com/bhearsum/bzrest/pull/2#discussion_r26946470","pull_request_url":"https://api.github.com/repos/bhearsum/bzrest/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/bhearsum/bzrest/pulls/comments/26946470"},"html":{"href":"https://github.com/bhearsum/bzrest/pull/2#discussion_r26946470"},"pull_request":{"href":"https://api.github.com/repos/bhearsum/bzrest/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/bhearsum/bzrest/pulls/2","id":31102882,"html_url":"https://github.com/bhearsum/bzrest/pull/2","diff_url":"https://github.com/bhearsum/bzrest/pull/2.diff","patch_url":"https://github.com/bhearsum/bzrest/pull/2.patch","issue_url":"https://api.github.com/repos/bhearsum/bzrest/issues/2","number":2,"state":"open","locked":false,"title":"Add Bugzilla api key login support","user":{"login":"Callek","id":1415602,"avatar_url":"https://avatars.githubusercontent.com/u/1415602?v=3","gravatar_id":"","url":"https://api.github.com/users/Callek","html_url":"https://github.com/Callek","followers_url":"https://api.github.com/users/Callek/followers","following_url":"https://api.github.com/users/Callek/following{/other_user}","gists_url":"https://api.github.com/users/Callek/gists{/gist_id}","starred_url":"https://api.github.com/users/Callek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Callek/subscriptions","organizations_url":"https://api.github.com/users/Callek/orgs","repos_url":"https://api.github.com/users/Callek/repos","events_url":"https://api.github.com/users/Callek/events{/privacy}","received_events_url":"https://api.github.com/users/Callek/received_events","type":"User","site_admin":false},"body":"I'm not a big fan of the code flow after this change, but I wanted to get a api key support in sooner than later.\r\n\r\nThis code allows specifying both user+pass and key, but will always use the key if provided. (It also sets the user+password to None if apikey is used, to try and limit the amount of places in memory the password could be stored, even if passed in)\r\n\r\nAs of tonight this code is untested. However api key support is defined at http://bugzilla.readthedocs.org/en/latest/api/core/v1/general.html#authentication","created_at":"2015-03-13T06:29:23Z","updated_at":"2015-03-23T15:25:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a97c722218585fb151ec3f41f11b8d8f002f988","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bhearsum/bzrest/pulls/2/commits","review_comments_url":"https://api.github.com/repos/bhearsum/bzrest/pulls/2/comments","review_comment_url":"https://api.github.com/repos/bhearsum/bzrest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bhearsum/bzrest/issues/2/comments","statuses_url":"https://api.github.com/repos/bhearsum/bzrest/statuses/fb9cc6c3bb2fa61791c1aadaef600ee74881ad25","head":{"label":"Callek:apikey","ref":"apikey","sha":"fb9cc6c3bb2fa61791c1aadaef600ee74881ad25","user":{"login":"Callek","id":1415602,"avatar_url":"https://avatars.githubusercontent.com/u/1415602?v=3","gravatar_id":"","url":"https://api.github.com/users/Callek","html_url":"https://github.com/Callek","followers_url":"https://api.github.com/users/Callek/followers","following_url":"https://api.github.com/users/Callek/following{/other_user}","gists_url":"https://api.github.com/users/Callek/gists{/gist_id}","starred_url":"https://api.github.com/users/Callek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Callek/subscriptions","organizations_url":"https://api.github.com/users/Callek/orgs","repos_url":"https://api.github.com/users/Callek/repos","events_url":"https://api.github.com/users/Callek/events{/privacy}","received_events_url":"https://api.github.com/users/Callek/received_events","type":"User","site_admin":false},"repo":{"id":30003202,"name":"bzrest","full_name":"Callek/bzrest","owner":{"login":"Callek","id":1415602,"avatar_url":"https://avatars.githubusercontent.com/u/1415602?v=3","gravatar_id":"","url":"https://api.github.com/users/Callek","html_url":"https://github.com/Callek","followers_url":"https://api.github.com/users/Callek/followers","following_url":"https://api.github.com/users/Callek/following{/other_user}","gists_url":"https://api.github.com/users/Callek/gists{/gist_id}","starred_url":"https://api.github.com/users/Callek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Callek/subscriptions","organizations_url":"https://api.github.com/users/Callek/orgs","repos_url":"https://api.github.com/users/Callek/repos","events_url":"https://api.github.com/users/Callek/events{/privacy}","received_events_url":"https://api.github.com/users/Callek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Callek/bzrest","description":"Client to Bugzilla's REST API","fork":true,"url":"https://api.github.com/repos/Callek/bzrest","forks_url":"https://api.github.com/repos/Callek/bzrest/forks","keys_url":"https://api.github.com/repos/Callek/bzrest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Callek/bzrest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Callek/bzrest/teams","hooks_url":"https://api.github.com/repos/Callek/bzrest/hooks","issue_events_url":"https://api.github.com/repos/Callek/bzrest/issues/events{/number}","events_url":"https://api.github.com/repos/Callek/bzrest/events","assignees_url":"https://api.github.com/repos/Callek/bzrest/assignees{/user}","branches_url":"https://api.github.com/repos/Callek/bzrest/branches{/branch}","tags_url":"https://api.github.com/repos/Callek/bzrest/tags","blobs_url":"https://api.github.com/repos/Callek/bzrest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Callek/bzrest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Callek/bzrest/git/refs{/sha}","trees_url":"https://api.github.com/repos/Callek/bzrest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Callek/bzrest/statuses/{sha}","languages_url":"https://api.github.com/repos/Callek/bzrest/languages","stargazers_url":"https://api.github.com/repos/Callek/bzrest/stargazers","contributors_url":"https://api.github.com/repos/Callek/bzrest/contributors","subscribers_url":"https://api.github.com/repos/Callek/bzrest/subscribers","subscription_url":"https://api.github.com/repos/Callek/bzrest/subscription","commits_url":"https://api.github.com/repos/Callek/bzrest/commits{/sha}","git_commits_url":"https://api.github.com/repos/Callek/bzrest/git/commits{/sha}","comments_url":"https://api.github.com/repos/Callek/bzrest/comments{/number}","issue_comment_url":"https://api.github.com/repos/Callek/bzrest/issues/comments{/number}","contents_url":"https://api.github.com/repos/Callek/bzrest/contents/{+path}","compare_url":"https://api.github.com/repos/Callek/bzrest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Callek/bzrest/merges","archive_url":"https://api.github.com/repos/Callek/bzrest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Callek/bzrest/downloads","issues_url":"https://api.github.com/repos/Callek/bzrest/issues{/number}","pulls_url":"https://api.github.com/repos/Callek/bzrest/pulls{/number}","milestones_url":"https://api.github.com/repos/Callek/bzrest/milestones{/number}","notifications_url":"https://api.github.com/repos/Callek/bzrest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Callek/bzrest/labels{/name}","releases_url":"https://api.github.com/repos/Callek/bzrest/releases{/id}","created_at":"2015-01-29T04:14:12Z","updated_at":"2015-01-29T04:14:13Z","pushed_at":"2015-03-13T06:27:01Z","git_url":"git://github.com/Callek/bzrest.git","ssh_url":"git@github.com:Callek/bzrest.git","clone_url":"https://github.com/Callek/bzrest.git","svn_url":"https://github.com/Callek/bzrest","homepage":null,"size":130,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"bhearsum:master","ref":"master","sha":"32fbd30c43c2e976183d9ec5a8eefc42d60079cb","user":{"login":"bhearsum","id":49649,"avatar_url":"https://avatars.githubusercontent.com/u/49649?v=3","gravatar_id":"","url":"https://api.github.com/users/bhearsum","html_url":"https://github.com/bhearsum","followers_url":"https://api.github.com/users/bhearsum/followers","following_url":"https://api.github.com/users/bhearsum/following{/other_user}","gists_url":"https://api.github.com/users/bhearsum/gists{/gist_id}","starred_url":"https://api.github.com/users/bhearsum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhearsum/subscriptions","organizations_url":"https://api.github.com/users/bhearsum/orgs","repos_url":"https://api.github.com/users/bhearsum/repos","events_url":"https://api.github.com/users/bhearsum/events{/privacy}","received_events_url":"https://api.github.com/users/bhearsum/received_events","type":"User","site_admin":false},"repo":{"id":11773697,"name":"bzrest","full_name":"bhearsum/bzrest","owner":{"login":"bhearsum","id":49649,"avatar_url":"https://avatars.githubusercontent.com/u/49649?v=3","gravatar_id":"","url":"https://api.github.com/users/bhearsum","html_url":"https://github.com/bhearsum","followers_url":"https://api.github.com/users/bhearsum/followers","following_url":"https://api.github.com/users/bhearsum/following{/other_user}","gists_url":"https://api.github.com/users/bhearsum/gists{/gist_id}","starred_url":"https://api.github.com/users/bhearsum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhearsum/subscriptions","organizations_url":"https://api.github.com/users/bhearsum/orgs","repos_url":"https://api.github.com/users/bhearsum/repos","events_url":"https://api.github.com/users/bhearsum/events{/privacy}","received_events_url":"https://api.github.com/users/bhearsum/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bhearsum/bzrest","description":"Client to Bugzilla's REST API","fork":false,"url":"https://api.github.com/repos/bhearsum/bzrest","forks_url":"https://api.github.com/repos/bhearsum/bzrest/forks","keys_url":"https://api.github.com/repos/bhearsum/bzrest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bhearsum/bzrest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bhearsum/bzrest/teams","hooks_url":"https://api.github.com/repos/bhearsum/bzrest/hooks","issue_events_url":"https://api.github.com/repos/bhearsum/bzrest/issues/events{/number}","events_url":"https://api.github.com/repos/bhearsum/bzrest/events","assignees_url":"https://api.github.com/repos/bhearsum/bzrest/assignees{/user}","branches_url":"https://api.github.com/repos/bhearsum/bzrest/branches{/branch}","tags_url":"https://api.github.com/repos/bhearsum/bzrest/tags","blobs_url":"https://api.github.com/repos/bhearsum/bzrest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bhearsum/bzrest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bhearsum/bzrest/git/refs{/sha}","trees_url":"https://api.github.com/repos/bhearsum/bzrest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bhearsum/bzrest/statuses/{sha}","languages_url":"https://api.github.com/repos/bhearsum/bzrest/languages","stargazers_url":"https://api.github.com/repos/bhearsum/bzrest/stargazers","contributors_url":"https://api.github.com/repos/bhearsum/bzrest/contributors","subscribers_url":"https://api.github.com/repos/bhearsum/bzrest/subscribers","subscription_url":"https://api.github.com/repos/bhearsum/bzrest/subscription","commits_url":"https://api.github.com/repos/bhearsum/bzrest/commits{/sha}","git_commits_url":"https://api.github.com/repos/bhearsum/bzrest/git/commits{/sha}","comments_url":"https://api.github.com/repos/bhearsum/bzrest/comments{/number}","issue_comment_url":"https://api.github.com/repos/bhearsum/bzrest/issues/comments{/number}","contents_url":"https://api.github.com/repos/bhearsum/bzrest/contents/{+path}","compare_url":"https://api.github.com/repos/bhearsum/bzrest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bhearsum/bzrest/merges","archive_url":"https://api.github.com/repos/bhearsum/bzrest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bhearsum/bzrest/downloads","issues_url":"https://api.github.com/repos/bhearsum/bzrest/issues{/number}","pulls_url":"https://api.github.com/repos/bhearsum/bzrest/pulls{/number}","milestones_url":"https://api.github.com/repos/bhearsum/bzrest/milestones{/number}","notifications_url":"https://api.github.com/repos/bhearsum/bzrest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bhearsum/bzrest/labels{/name}","releases_url":"https://api.github.com/repos/bhearsum/bzrest/releases{/id}","created_at":"2013-07-30T19:32:44Z","updated_at":"2015-02-21T19:16:21Z","pushed_at":"2015-02-02T17:58:01Z","git_url":"git://github.com/bhearsum/bzrest.git","ssh_url":"git@github.com:bhearsum/bzrest.git","clone_url":"https://github.com/bhearsum/bzrest.git","svn_url":"https://github.com/bhearsum/bzrest","homepage":null,"size":210,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bhearsum/bzrest/pulls/2"},"html":{"href":"https://github.com/bhearsum/bzrest/pull/2"},"issue":{"href":"https://api.github.com/repos/bhearsum/bzrest/issues/2"},"comments":{"href":"https://api.github.com/repos/bhearsum/bzrest/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/bhearsum/bzrest/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/bhearsum/bzrest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bhearsum/bzrest/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/bhearsum/bzrest/statuses/fb9cc6c3bb2fa61791c1aadaef600ee74881ad25"}}}}