{"action":"created","comment":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/34827214","id":34827214,"diff_hunk":"@@ -0,0 +1,34 @@\n+class OpenidConnect::IdToken < ActiveRecord::Base\n+  belongs_to :authorization\n+\n+  before_validation :setup, on: :create\n+\n+  default_scope -> { where(\"expires_at >= ?\", Time.now.utc) }\n+\n+  def setup\n+    self.expires_at = 30.minutes.from_now\n+  end\n+\n+  def to_jwt(options={})\n+    to_response_object(options).to_jwt OpenidConnect::IdTokenConfig.private_key\n+  end\n+\n+  def to_response_object(options={})\n+    claims = {\n+      iss:       AppConfig.environment.url,\n+      sub:       AppConfig.environment.url + authorization.o_auth_application.client_id.to_s + authorization.user.id.to_s, # TODO: Convert to proper PPID","path":"app/models/openid_connect/id_token.rb","position":19,"original_position":19,"commit_id":"9810d75ac0bae5458663d3460fafe0fecb0af41d","original_commit_id":"9810d75ac0bae5458663d3460fafe0fecb0af41d","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [153/120]<br>Unnecessary spacing detected.","created_at":"2015-07-16T19:20:56Z","updated_at":"2015-07-16T19:20:56Z","html_url":"https://github.com/diaspora/diaspora/pull/6095#discussion_r34827214","pull_request_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095","_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/34827214"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6095#discussion_r34827214"},"pull_request":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095"}}},"pull_request":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095","id":37606141,"html_url":"https://github.com/diaspora/diaspora/pull/6095","diff_url":"https://github.com/diaspora/diaspora/pull/6095.diff","patch_url":"https://github.com/diaspora/diaspora/pull/6095.patch","issue_url":"https://api.github.com/repos/diaspora/diaspora/issues/6095","number":6095,"state":"open","locked":false,"title":"[WIP] OpenID Connect ","user":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"body":"Please refer to #6182 to follow the current going on work.","created_at":"2015-06-12T21:29:08Z","updated_at":"2015-07-16T19:20:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"920fa4e9688ffc764c1c50a5fe13703238d23320","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/commits","review_comments_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/comments","review_comment_url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diaspora/diaspora/issues/6095/comments","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/9810d75ac0bae5458663d3460fafe0fecb0af41d","head":{"label":"AugierLe42e:openid","ref":"openid","sha":"9810d75ac0bae5458663d3460fafe0fecb0af41d","user":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"repo":{"id":25200087,"name":"diaspora","full_name":"AugierLe42e/diaspora","owner":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AugierLe42e/diaspora","description":"Distributed and contextual social networking","fork":true,"url":"https://api.github.com/repos/AugierLe42e/diaspora","forks_url":"https://api.github.com/repos/AugierLe42e/diaspora/forks","keys_url":"https://api.github.com/repos/AugierLe42e/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AugierLe42e/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AugierLe42e/diaspora/teams","hooks_url":"https://api.github.com/repos/AugierLe42e/diaspora/hooks","issue_events_url":"https://api.github.com/repos/AugierLe42e/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/AugierLe42e/diaspora/events","assignees_url":"https://api.github.com/repos/AugierLe42e/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/AugierLe42e/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/AugierLe42e/diaspora/tags","blobs_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AugierLe42e/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/AugierLe42e/diaspora/languages","stargazers_url":"https://api.github.com/repos/AugierLe42e/diaspora/stargazers","contributors_url":"https://api.github.com/repos/AugierLe42e/diaspora/contributors","subscribers_url":"https://api.github.com/repos/AugierLe42e/diaspora/subscribers","subscription_url":"https://api.github.com/repos/AugierLe42e/diaspora/subscription","commits_url":"https://api.github.com/repos/AugierLe42e/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/AugierLe42e/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/AugierLe42e/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/AugierLe42e/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/AugierLe42e/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AugierLe42e/diaspora/merges","archive_url":"https://api.github.com/repos/AugierLe42e/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AugierLe42e/diaspora/downloads","issues_url":"https://api.github.com/repos/AugierLe42e/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/AugierLe42e/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/AugierLe42e/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/AugierLe42e/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AugierLe42e/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/AugierLe42e/diaspora/releases{/id}","created_at":"2014-10-14T09:47:25Z","updated_at":"2015-06-14T15:25:04Z","pushed_at":"2015-07-16T19:20:33Z","git_url":"git://github.com/AugierLe42e/diaspora.git","ssh_url":"git@github.com:AugierLe42e/diaspora.git","clone_url":"https://github.com/AugierLe42e/diaspora.git","svn_url":"https://github.com/AugierLe42e/diaspora","homepage":"https://diasporafoundation.org/","size":102590,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"diaspora:develop","ref":"develop","sha":"0e439f6c1c66e46457bd26ff640c2278e53d9b9b","user":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"repo":{"id":911765,"name":"diaspora","full_name":"diaspora/diaspora","owner":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diaspora/diaspora","description":"Distributed and contextual social networking","fork":false,"url":"https://api.github.com/repos/diaspora/diaspora","forks_url":"https://api.github.com/repos/diaspora/diaspora/forks","keys_url":"https://api.github.com/repos/diaspora/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diaspora/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diaspora/diaspora/teams","hooks_url":"https://api.github.com/repos/diaspora/diaspora/hooks","issue_events_url":"https://api.github.com/repos/diaspora/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/diaspora/diaspora/events","assignees_url":"https://api.github.com/repos/diaspora/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/diaspora/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/diaspora/diaspora/tags","blobs_url":"https://api.github.com/repos/diaspora/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diaspora/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diaspora/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/diaspora/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/diaspora/diaspora/languages","stargazers_url":"https://api.github.com/repos/diaspora/diaspora/stargazers","contributors_url":"https://api.github.com/repos/diaspora/diaspora/contributors","subscribers_url":"https://api.github.com/repos/diaspora/diaspora/subscribers","subscription_url":"https://api.github.com/repos/diaspora/diaspora/subscription","commits_url":"https://api.github.com/repos/diaspora/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/diaspora/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/diaspora/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/diaspora/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/diaspora/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/diaspora/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diaspora/diaspora/merges","archive_url":"https://api.github.com/repos/diaspora/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diaspora/diaspora/downloads","issues_url":"https://api.github.com/repos/diaspora/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/diaspora/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/diaspora/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/diaspora/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diaspora/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/diaspora/diaspora/releases{/id}","created_at":"2010-09-15T05:20:04Z","updated_at":"2015-07-16T10:07:34Z","pushed_at":"2015-07-16T19:20:34Z","git_url":"git://github.com/diaspora/diaspora.git","ssh_url":"git@github.com:diaspora/diaspora.git","clone_url":"https://github.com/diaspora/diaspora.git","svn_url":"https://github.com/diaspora/diaspora","homepage":"https://diasporafoundation.org/","size":253266,"stargazers_count":10148,"watchers_count":10148,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2631,"mirror_url":null,"open_issues_count":410,"forks":2631,"open_issues":410,"watchers":10148,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6095"},"issue":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6095"},"comments":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6095/comments"},"review_comments":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/comments"},"review_comment":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/commits"},"statuses":{"href":"https://api.github.com/repos/diaspora/diaspora/statuses/9810d75ac0bae5458663d3460fafe0fecb0af41d"}}}}