{"action":"created","comment":{"url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/comments/66177503","id":66177503,"diff_hunk":"@@ -34,10 +35,12 @@ def request(self, method, url_parts, headers=None, data=None):\n       headers = headers or {}\n \n       # test if Oauth token\n-      if \":\" in self.api_key:\n+      if self.token_type == 'legacy':\n         headers.update({'Token': self.api_key, 'User-Agent': 'optimizely-client-python/0.1.1'})\n-      else:\n+      elif self.token_type == 'oauth':\n         headers.update({'Authorization': ' Bearer ' + self.api_key, 'User-Agent': 'optimizely-client-python/0.1.1'})\n+      else:\n+        raise error.BadRequestError('%s is not a valid token type.' % token_type)","path":"optimizely/client.py","position":24,"original_position":24,"commit_id":"4a7d2ea9e6a01ce13ec3577438b2085a61f11630","original_commit_id":"4a7d2ea9e6a01ce13ec3577438b2085a61f11630","user":{"login":"jgaul","id":3065290,"avatar_url":"https://avatars.githubusercontent.com/u/3065290?v=3","gravatar_id":"","url":"https://api.github.com/users/jgaul","html_url":"https://github.com/jgaul","followers_url":"https://api.github.com/users/jgaul/followers","following_url":"https://api.github.com/users/jgaul/following{/other_user}","gists_url":"https://api.github.com/users/jgaul/gists{/gist_id}","starred_url":"https://api.github.com/users/jgaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgaul/subscriptions","organizations_url":"https://api.github.com/users/jgaul/orgs","repos_url":"https://api.github.com/users/jgaul/repos","events_url":"https://api.github.com/users/jgaul/events{/privacy}","received_events_url":"https://api.github.com/users/jgaul/received_events","type":"User","site_admin":false},"body":"`BadRequestError` wouldn't be appropriate here since it's not an HTTP error","created_at":"2016-06-08T00:46:02Z","updated_at":"2016-06-08T00:46:02Z","html_url":"https://github.com/optimizely/optimizely-client-python/pull/15#discussion_r66177503","pull_request_url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/comments/66177503"},"html":{"href":"https://github.com/optimizely/optimizely-client-python/pull/15#discussion_r66177503"},"pull_request":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15","id":72970845,"html_url":"https://github.com/optimizely/optimizely-client-python/pull/15","diff_url":"https://github.com/optimizely/optimizely-client-python/pull/15.diff","patch_url":"https://github.com/optimizely/optimizely-client-python/pull/15.patch","issue_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/15","number":15,"state":"open","locked":false,"title":"handle token type","user":{"login":"mauerbac","id":1507886,"avatar_url":"https://avatars.githubusercontent.com/u/1507886?v=3","gravatar_id":"","url":"https://api.github.com/users/mauerbac","html_url":"https://github.com/mauerbac","followers_url":"https://api.github.com/users/mauerbac/followers","following_url":"https://api.github.com/users/mauerbac/following{/other_user}","gists_url":"https://api.github.com/users/mauerbac/gists{/gist_id}","starred_url":"https://api.github.com/users/mauerbac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauerbac/subscriptions","organizations_url":"https://api.github.com/users/mauerbac/orgs","repos_url":"https://api.github.com/users/mauerbac/repos","events_url":"https://api.github.com/users/mauerbac/events{/privacy}","received_events_url":"https://api.github.com/users/mauerbac/received_events","type":"User","site_admin":false},"body":"how does this look @jgaul ","created_at":"2016-06-08T00:37:40Z","updated_at":"2016-06-08T00:46:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22cb0141ae4d1eed341c43fe7dbd6b12c2a10d87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15/commits","review_comments_url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15/comments","review_comment_url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/15/comments","statuses_url":"https://api.github.com/repos/optimizely/optimizely-client-python/statuses/4a7d2ea9e6a01ce13ec3577438b2085a61f11630","head":{"label":"optimizely:matt/token","ref":"matt/token","sha":"4a7d2ea9e6a01ce13ec3577438b2085a61f11630","user":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"repo":{"id":24215329,"name":"optimizely-client-python","full_name":"optimizely/optimizely-client-python","owner":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/optimizely/optimizely-client-python","description":"Optimizely's Python client library is an interface to its REST API.","fork":false,"url":"https://api.github.com/repos/optimizely/optimizely-client-python","forks_url":"https://api.github.com/repos/optimizely/optimizely-client-python/forks","keys_url":"https://api.github.com/repos/optimizely/optimizely-client-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/optimizely/optimizely-client-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/optimizely/optimizely-client-python/teams","hooks_url":"https://api.github.com/repos/optimizely/optimizely-client-python/hooks","issue_events_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/events{/number}","events_url":"https://api.github.com/repos/optimizely/optimizely-client-python/events","assignees_url":"https://api.github.com/repos/optimizely/optimizely-client-python/assignees{/user}","branches_url":"https://api.github.com/repos/optimizely/optimizely-client-python/branches{/branch}","tags_url":"https://api.github.com/repos/optimizely/optimizely-client-python/tags","blobs_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/optimizely/optimizely-client-python/statuses/{sha}","languages_url":"https://api.github.com/repos/optimizely/optimizely-client-python/languages","stargazers_url":"https://api.github.com/repos/optimizely/optimizely-client-python/stargazers","contributors_url":"https://api.github.com/repos/optimizely/optimizely-client-python/contributors","subscribers_url":"https://api.github.com/repos/optimizely/optimizely-client-python/subscribers","subscription_url":"https://api.github.com/repos/optimizely/optimizely-client-python/subscription","commits_url":"https://api.github.com/repos/optimizely/optimizely-client-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/optimizely/optimizely-client-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/optimizely/optimizely-client-python/contents/{+path}","compare_url":"https://api.github.com/repos/optimizely/optimizely-client-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/optimizely/optimizely-client-python/merges","archive_url":"https://api.github.com/repos/optimizely/optimizely-client-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/optimizely/optimizely-client-python/downloads","issues_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues{/number}","pulls_url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls{/number}","milestones_url":"https://api.github.com/repos/optimizely/optimizely-client-python/milestones{/number}","notifications_url":"https://api.github.com/repos/optimizely/optimizely-client-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/optimizely/optimizely-client-python/labels{/name}","releases_url":"https://api.github.com/repos/optimizely/optimizely-client-python/releases{/id}","deployments_url":"https://api.github.com/repos/optimizely/optimizely-client-python/deployments","created_at":"2014-09-19T03:52:50Z","updated_at":"2016-05-11T18:21:51Z","pushed_at":"2016-06-08T00:37:40Z","git_url":"git://github.com/optimizely/optimizely-client-python.git","ssh_url":"git@github.com:optimizely/optimizely-client-python.git","clone_url":"https://github.com/optimizely/optimizely-client-python.git","svn_url":"https://github.com/optimizely/optimizely-client-python","homepage":null,"size":42,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":15,"default_branch":"master"}},"base":{"label":"optimizely:master","ref":"master","sha":"1eea75ce5575245625132ac1391ac4432c59c527","user":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"repo":{"id":24215329,"name":"optimizely-client-python","full_name":"optimizely/optimizely-client-python","owner":{"login":"optimizely","id":1274132,"avatar_url":"https://avatars.githubusercontent.com/u/1274132?v=3","gravatar_id":"","url":"https://api.github.com/users/optimizely","html_url":"https://github.com/optimizely","followers_url":"https://api.github.com/users/optimizely/followers","following_url":"https://api.github.com/users/optimizely/following{/other_user}","gists_url":"https://api.github.com/users/optimizely/gists{/gist_id}","starred_url":"https://api.github.com/users/optimizely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimizely/subscriptions","organizations_url":"https://api.github.com/users/optimizely/orgs","repos_url":"https://api.github.com/users/optimizely/repos","events_url":"https://api.github.com/users/optimizely/events{/privacy}","received_events_url":"https://api.github.com/users/optimizely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/optimizely/optimizely-client-python","description":"Optimizely's Python client library is an interface to its REST API.","fork":false,"url":"https://api.github.com/repos/optimizely/optimizely-client-python","forks_url":"https://api.github.com/repos/optimizely/optimizely-client-python/forks","keys_url":"https://api.github.com/repos/optimizely/optimizely-client-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/optimizely/optimizely-client-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/optimizely/optimizely-client-python/teams","hooks_url":"https://api.github.com/repos/optimizely/optimizely-client-python/hooks","issue_events_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/events{/number}","events_url":"https://api.github.com/repos/optimizely/optimizely-client-python/events","assignees_url":"https://api.github.com/repos/optimizely/optimizely-client-python/assignees{/user}","branches_url":"https://api.github.com/repos/optimizely/optimizely-client-python/branches{/branch}","tags_url":"https://api.github.com/repos/optimizely/optimizely-client-python/tags","blobs_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/optimizely/optimizely-client-python/statuses/{sha}","languages_url":"https://api.github.com/repos/optimizely/optimizely-client-python/languages","stargazers_url":"https://api.github.com/repos/optimizely/optimizely-client-python/stargazers","contributors_url":"https://api.github.com/repos/optimizely/optimizely-client-python/contributors","subscribers_url":"https://api.github.com/repos/optimizely/optimizely-client-python/subscribers","subscription_url":"https://api.github.com/repos/optimizely/optimizely-client-python/subscription","commits_url":"https://api.github.com/repos/optimizely/optimizely-client-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/optimizely/optimizely-client-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/optimizely/optimizely-client-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/optimizely/optimizely-client-python/contents/{+path}","compare_url":"https://api.github.com/repos/optimizely/optimizely-client-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/optimizely/optimizely-client-python/merges","archive_url":"https://api.github.com/repos/optimizely/optimizely-client-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/optimizely/optimizely-client-python/downloads","issues_url":"https://api.github.com/repos/optimizely/optimizely-client-python/issues{/number}","pulls_url":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls{/number}","milestones_url":"https://api.github.com/repos/optimizely/optimizely-client-python/milestones{/number}","notifications_url":"https://api.github.com/repos/optimizely/optimizely-client-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/optimizely/optimizely-client-python/labels{/name}","releases_url":"https://api.github.com/repos/optimizely/optimizely-client-python/releases{/id}","deployments_url":"https://api.github.com/repos/optimizely/optimizely-client-python/deployments","created_at":"2014-09-19T03:52:50Z","updated_at":"2016-05-11T18:21:51Z","pushed_at":"2016-06-08T00:37:40Z","git_url":"git://github.com/optimizely/optimizely-client-python.git","ssh_url":"git@github.com:optimizely/optimizely-client-python.git","clone_url":"https://github.com/optimizely/optimizely-client-python.git","svn_url":"https://github.com/optimizely/optimizely-client-python","homepage":null,"size":42,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15"},"html":{"href":"https://github.com/optimizely/optimizely-client-python/pull/15"},"issue":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/15"},"comments":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/optimizely/optimizely-client-python/statuses/4a7d2ea9e6a01ce13ec3577438b2085a61f11630"}}}}
{"actor":{"display_login":"jgaul"}}