{"action":"created","comment":{"url":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments/33568774","id":33568774,"diff_hunk":"@@ -0,0 +1,37 @@\n+from urllib import parse as urlparse\n+from social.backends.open_id import OpenIdAuth\n+from social.exceptions import AuthMissingParameter\n+\n+\n+class ClavidAbstractBaseOpenId(OpenIdAuth):\n+    openID_url = None\n+\n+    def __init__(self, *args, **kwargs):\n+        assert type(self) is not ClavidAbstractBaseOpenId\n+        assert self.openID_url is not None\n+        super().__init__(*args, **kwargs)\n+\n+    def get_user_details(self, response):\n+        \"\"\"Generate username from identity url\"\"\"\n+        values = super().get_user_details(response)\n+        values['username'] = values.get('username') or \\\n+            urlparse.urlsplit(response.identity_url).netloc.split('.', 1)[0]\n+        return values\n+\n+    def openid_url(self):\n+        \"\"\"Returns clavid authentication URL\"\"\"\n+        if not self.data.get('openid_user'):\n+            raise AuthMissingParameter(self, 'openid_user')\n+        return 'http://%s.%s' % (self.data['openid_user'], self.openID_url)\n+\n+\n+class ClavidComOpenId(ClavidAbstractBaseOpenId):\n+    \"\"\"clavid.com OpenID authentication backend\"\"\"\n+    name = 'clavid.com'","path":"osmaxx-py/osmaxx/social_auth/backends/clavid_backend.py","position":30,"original_position":30,"commit_id":"1ed0be252e163db50a2b823044e41a2f09714329","original_commit_id":"1ed0be252e163db50a2b823044e41a2f09714329","user":{"login":"njordan-hsr","id":8830664,"avatar_url":"https://avatars.githubusercontent.com/u/8830664?v=3","gravatar_id":"","url":"https://api.github.com/users/njordan-hsr","html_url":"https://github.com/njordan-hsr","followers_url":"https://api.github.com/users/njordan-hsr/followers","following_url":"https://api.github.com/users/njordan-hsr/following{/other_user}","gists_url":"https://api.github.com/users/njordan-hsr/gists{/gist_id}","starred_url":"https://api.github.com/users/njordan-hsr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njordan-hsr/subscriptions","organizations_url":"https://api.github.com/users/njordan-hsr/orgs","repos_url":"https://api.github.com/users/njordan-hsr/repos","events_url":"https://api.github.com/users/njordan-hsr/events{/privacy}","received_events_url":"https://api.github.com/users/njordan-hsr/received_events","type":"User","site_admin":false},"body":"Yes, see: http://psa.matiasaguirre.net/docs/backends/implementation.html#common-attributes","created_at":"2015-06-30T12:54:47Z","updated_at":"2015-06-30T12:54:47Z","html_url":"https://github.com/geometalab/osmaxx/pull/130#discussion_r33568774","pull_request_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/130","_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments/33568774"},"html":{"href":"https://github.com/geometalab/osmaxx/pull/130#discussion_r33568774"},"pull_request":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/130"}}},"pull_request":{"url":"https://api.github.com/repos/geometalab/osmaxx/pulls/130","id":38775950,"html_url":"https://github.com/geometalab/osmaxx/pull/130","diff_url":"https://github.com/geometalab/osmaxx/pull/130.diff","patch_url":"https://github.com/geometalab/osmaxx/pull/130.patch","issue_url":"https://api.github.com/repos/geometalab/osmaxx/issues/130","number":130,"state":"open","locked":false,"title":"Feature/check o auth/open id providers and configure app #109","user":{"login":"njordan-hsr","id":8830664,"avatar_url":"https://avatars.githubusercontent.com/u/8830664?v=3","gravatar_id":"","url":"https://api.github.com/users/njordan-hsr","html_url":"https://github.com/njordan-hsr","followers_url":"https://api.github.com/users/njordan-hsr/followers","following_url":"https://api.github.com/users/njordan-hsr/following{/other_user}","gists_url":"https://api.github.com/users/njordan-hsr/gists{/gist_id}","starred_url":"https://api.github.com/users/njordan-hsr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njordan-hsr/subscriptions","organizations_url":"https://api.github.com/users/njordan-hsr/orgs","repos_url":"https://api.github.com/users/njordan-hsr/repos","events_url":"https://api.github.com/users/njordan-hsr/events{/privacy}","received_events_url":"https://api.github.com/users/njordan-hsr/received_events","type":"User","site_admin":false},"body":"Basic Clavid login through OpenID.\r\n\r\nRan tests: OK","created_at":"2015-06-29T13:56:54Z","updated_at":"2015-06-30T12:54:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5d0d2c8b75471fdb2a0a3d98c5bed691e99364f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/130/commits","review_comments_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/130/comments","review_comment_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/issues/130/comments","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/1ed0be252e163db50a2b823044e41a2f09714329","head":{"label":"geometalab:feature/Check-OAuth/OpenID-Providers-and-configure-app-#109","ref":"feature/Check-OAuth/OpenID-Providers-and-configure-app-#109","sha":"1ed0be252e163db50a2b823044e41a2f09714329","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":28986110,"name":"osmaxx","full_name":"geometalab/osmaxx","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx","description":"OpenStreetMap Arbitrary eXcerpt eXport (main repository)","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx","forks_url":"https://api.github.com/repos/geometalab/osmaxx/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx/releases{/id}","created_at":"2015-01-08T21:05:34Z","updated_at":"2015-05-06T08:37:55Z","pushed_at":"2015-06-30T07:25:07Z","git_url":"git://github.com/geometalab/osmaxx.git","ssh_url":"git@github.com:geometalab/osmaxx.git","clone_url":"https://github.com/geometalab/osmaxx.git","svn_url":"https://github.com/geometalab/osmaxx","homepage":"http://osmaxx.hsr.ch/","size":2157,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":28,"forks":0,"open_issues":28,"watchers":1,"default_branch":"develop"}},"base":{"label":"geometalab:develop","ref":"develop","sha":"fac3986307478442c922f867649c748660f97916","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":28986110,"name":"osmaxx","full_name":"geometalab/osmaxx","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx","description":"OpenStreetMap Arbitrary eXcerpt eXport (main repository)","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx","forks_url":"https://api.github.com/repos/geometalab/osmaxx/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx/releases{/id}","created_at":"2015-01-08T21:05:34Z","updated_at":"2015-05-06T08:37:55Z","pushed_at":"2015-06-30T07:25:07Z","git_url":"git://github.com/geometalab/osmaxx.git","ssh_url":"git@github.com:geometalab/osmaxx.git","clone_url":"https://github.com/geometalab/osmaxx.git","svn_url":"https://github.com/geometalab/osmaxx","homepage":"http://osmaxx.hsr.ch/","size":2157,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":28,"forks":0,"open_issues":28,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/130"},"html":{"href":"https://github.com/geometalab/osmaxx/pull/130"},"issue":{"href":"https://api.github.com/repos/geometalab/osmaxx/issues/130"},"comments":{"href":"https://api.github.com/repos/geometalab/osmaxx/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/geometalab/osmaxx/statuses/1ed0be252e163db50a2b823044e41a2f09714329"}}}}