{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/solitude/pulls/comments/30936853","id":30936853,"diff_hunk":"@@ -8,11 +9,31 @@\n log = getLogger('s.brains')\n \n \n+class AuthEnvironment(braintree.environment.Environment):\n+\n+    def __init__(self, real):\n+        self._url = urlparse(settings.BRAINTREE_PROXY)\n+        self._real = real\n+\n+        super(self.__class__, self).__init__(\n+            self._url.hostname, self._url.port, '',\n+            self._url.scheme == 'https', None)\n+\n+\n+AuthSandbox = AuthEnvironment(braintree.environment.Environment.Sandbox)\n+AuthProduction = AuthEnvironment(braintree.environment.Environment.Production)\n+\n+\n class Http(braintree.util.http.Http):\n \n-    def http_do(self, *args, **kw):\n+    def http_do(self, verb, path, headers, body):\n+        # Tell solitude-auth where we really want this request to go to.\n+        headers['x-solitude-url'] = self.environment._real.base_url + path\n+        # Set the URL of the request to point to the auth server.\n+        path = self.env\n+\n         with statsd.timer('solitude.braintree.api'):","path":"lib/brains/client.py","position":33,"original_position":33,"commit_id":"535c1cbdf5cb7cb0136d63fda6ec3c6c2afccb75","original_commit_id":"535c1cbdf5cb7cb0136d63fda6ec3c6c2afccb75","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"body":"Yeah good idea. I think everything gets prefixed so its in a different namespace, but will help confusion later on.","created_at":"2015-05-22T23:01:16Z","updated_at":"2015-05-22T23:01:16Z","html_url":"https://github.com/mozilla/solitude/pull/414#discussion_r30936853","pull_request_url":"https://api.github.com/repos/mozilla/solitude/pulls/414","_links":{"self":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/comments/30936853"},"html":{"href":"https://github.com/mozilla/solitude/pull/414#discussion_r30936853"},"pull_request":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/414"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/solitude/pulls/414","id":35482913,"html_url":"https://github.com/mozilla/solitude/pull/414","diff_url":"https://github.com/mozilla/solitude/pull/414.diff","patch_url":"https://github.com/mozilla/solitude/pull/414.patch","issue_url":"https://api.github.com/repos/mozilla/solitude/issues/414","number":414,"state":"open","locked":false,"title":"make braintree use solitude-auth","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"body":"fixes mozilla/payments#19","created_at":"2015-05-15T03:52:31Z","updated_at":"2015-05-22T23:01:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15344013412d27e38a22e05c11210f183649102f","assignee":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/solitude/pulls/414/commits","review_comments_url":"https://api.github.com/repos/mozilla/solitude/pulls/414/comments","review_comment_url":"https://api.github.com/repos/mozilla/solitude/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/solitude/issues/414/comments","statuses_url":"https://api.github.com/repos/mozilla/solitude/statuses/535c1cbdf5cb7cb0136d63fda6ec3c6c2afccb75","head":{"label":"andymckay:solitude-auth","ref":"solitude-auth","sha":"535c1cbdf5cb7cb0136d63fda6ec3c6c2afccb75","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"repo":{"id":23588659,"name":"solitude","full_name":"andymckay/solitude","owner":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andymckay/solitude","description":"A server for processing payments for Mozilla’s Marketplace and Add-ons site.","fork":true,"url":"https://api.github.com/repos/andymckay/solitude","forks_url":"https://api.github.com/repos/andymckay/solitude/forks","keys_url":"https://api.github.com/repos/andymckay/solitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andymckay/solitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andymckay/solitude/teams","hooks_url":"https://api.github.com/repos/andymckay/solitude/hooks","issue_events_url":"https://api.github.com/repos/andymckay/solitude/issues/events{/number}","events_url":"https://api.github.com/repos/andymckay/solitude/events","assignees_url":"https://api.github.com/repos/andymckay/solitude/assignees{/user}","branches_url":"https://api.github.com/repos/andymckay/solitude/branches{/branch}","tags_url":"https://api.github.com/repos/andymckay/solitude/tags","blobs_url":"https://api.github.com/repos/andymckay/solitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andymckay/solitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andymckay/solitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/andymckay/solitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andymckay/solitude/statuses/{sha}","languages_url":"https://api.github.com/repos/andymckay/solitude/languages","stargazers_url":"https://api.github.com/repos/andymckay/solitude/stargazers","contributors_url":"https://api.github.com/repos/andymckay/solitude/contributors","subscribers_url":"https://api.github.com/repos/andymckay/solitude/subscribers","subscription_url":"https://api.github.com/repos/andymckay/solitude/subscription","commits_url":"https://api.github.com/repos/andymckay/solitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/andymckay/solitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/andymckay/solitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/andymckay/solitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/andymckay/solitude/contents/{+path}","compare_url":"https://api.github.com/repos/andymckay/solitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andymckay/solitude/merges","archive_url":"https://api.github.com/repos/andymckay/solitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andymckay/solitude/downloads","issues_url":"https://api.github.com/repos/andymckay/solitude/issues{/number}","pulls_url":"https://api.github.com/repos/andymckay/solitude/pulls{/number}","milestones_url":"https://api.github.com/repos/andymckay/solitude/milestones{/number}","notifications_url":"https://api.github.com/repos/andymckay/solitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andymckay/solitude/labels{/name}","releases_url":"https://api.github.com/repos/andymckay/solitude/releases{/id}","created_at":"2014-09-02T17:37:20Z","updated_at":"2015-04-19T15:06:31Z","pushed_at":"2015-05-22T21:55:45Z","git_url":"git://github.com/andymckay/solitude.git","ssh_url":"git@github.com:andymckay/solitude.git","clone_url":"https://github.com/andymckay/solitude.git","svn_url":"https://github.com/andymckay/solitude","homepage":"http://readthedocs.org/docs/solitude/en/latest/","size":4159,"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":"mozilla:master","ref":"master","sha":"4e237aec5f1e7b8a3bc4b110cd69cf0320cef426","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":4566171,"name":"solitude","full_name":"mozilla/solitude","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/solitude","description":"A server for processing payments for Mozilla’s Marketplace.","fork":false,"url":"https://api.github.com/repos/mozilla/solitude","forks_url":"https://api.github.com/repos/mozilla/solitude/forks","keys_url":"https://api.github.com/repos/mozilla/solitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/solitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/solitude/teams","hooks_url":"https://api.github.com/repos/mozilla/solitude/hooks","issue_events_url":"https://api.github.com/repos/mozilla/solitude/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/solitude/events","assignees_url":"https://api.github.com/repos/mozilla/solitude/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/solitude/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/solitude/tags","blobs_url":"https://api.github.com/repos/mozilla/solitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/solitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/solitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/solitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/solitude/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/solitude/languages","stargazers_url":"https://api.github.com/repos/mozilla/solitude/stargazers","contributors_url":"https://api.github.com/repos/mozilla/solitude/contributors","subscribers_url":"https://api.github.com/repos/mozilla/solitude/subscribers","subscription_url":"https://api.github.com/repos/mozilla/solitude/subscription","commits_url":"https://api.github.com/repos/mozilla/solitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/solitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/solitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/solitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/solitude/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/solitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/solitude/merges","archive_url":"https://api.github.com/repos/mozilla/solitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/solitude/downloads","issues_url":"https://api.github.com/repos/mozilla/solitude/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/solitude/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/solitude/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/solitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/solitude/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/solitude/releases{/id}","created_at":"2012-06-05T22:13:53Z","updated_at":"2015-05-22T06:49:34Z","pushed_at":"2015-05-22T21:55:45Z","git_url":"git://github.com/mozilla/solitude.git","ssh_url":"git@github.com:mozilla/solitude.git","clone_url":"https://github.com/mozilla/solitude.git","svn_url":"https://github.com/mozilla/solitude","homepage":"http://readthedocs.org/docs/solitude/en/latest/","size":7431,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":13,"forks":27,"open_issues":13,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/414"},"html":{"href":"https://github.com/mozilla/solitude/pull/414"},"issue":{"href":"https://api.github.com/repos/mozilla/solitude/issues/414"},"comments":{"href":"https://api.github.com/repos/mozilla/solitude/issues/414/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/414/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/414/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/solitude/statuses/535c1cbdf5cb7cb0136d63fda6ec3c6c2afccb75"}}}}