{"action":"created","comment":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/178032588","pull_request_review_id":108018716,"id":178032588,"diff_hunk":"@@ -418,6 +422,49 @@ def setup(opts)\n     self\n   end\n \n+  def pam_managed_user?\n+    return false unless Devise.pam_authentication\n+    name = pam_get_name\n+    return false unless name\n+    Rpam2.account(Devise.pam_default_service, name).present?\n+  end\n+\n+  def no_pam_conflict\n+    errors.add(:username, \"username conflicts with pam account\") if pam_conflict?\n+  end\n+\n+  def pam_conflict?\n+    encrypted_password.present? && pam_managed_user?\n+  end\n+\n+  def pam_conflict(_attributes)\n+    # block pam logins on users with pw\n+    nil\n+  end\n+\n+  def pam_setup(attributes)\n+    args = {}\n+    args['username'] = self[::Devise.usernamefield]\n+    args['email'] = Rpam2.getenv(find_pam_service, self[::Devise.usernamefield], attributes[:password], 'email')","path":"app/models/user.rb","position":52,"original_position":52,"commit_id":"b67b12c786ffca8884f42112b67d4d5d22729a25","original_commit_id":"b67b12c786ffca8884f42112b67d4d5d22729a25","user":{"login":"diaspora-code-review","id":13334186,"avatar_url":"https://avatars3.githubusercontent.com/u/13334186?v=4","gravatar_id":"","url":"https://api.github.com/users/diaspora-code-review","html_url":"https://github.com/diaspora-code-review","followers_url":"https://api.github.com/users/diaspora-code-review/followers","following_url":"https://api.github.com/users/diaspora-code-review/following{/other_user}","gists_url":"https://api.github.com/users/diaspora-code-review/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora-code-review/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora-code-review/subscriptions","organizations_url":"https://api.github.com/users/diaspora-code-review/orgs","repos_url":"https://api.github.com/users/diaspora-code-review/repos","events_url":"https://api.github.com/users/diaspora-code-review/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora-code-review/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2018-03-29T11:55:49Z","updated_at":"2018-03-29T11:55:49Z","html_url":"https://github.com/diaspora/diaspora/pull/7728#discussion_r178032588","pull_request_url":"https://api.github.com/repos/diaspora/diaspora/pulls/7728","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/178032588"},"html":{"href":"https://github.com/diaspora/diaspora/pull/7728#discussion_r178032588"},"pull_request":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7728"}}},"pull_request":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/7728","id":172528191,"html_url":"https://github.com/diaspora/diaspora/pull/7728","diff_url":"https://github.com/diaspora/diaspora/pull/7728.diff","patch_url":"https://github.com/diaspora/diaspora/pull/7728.patch","issue_url":"https://api.github.com/repos/diaspora/diaspora/issues/7728","number":7728,"state":"open","locked":false,"title":"pam authentication","user":{"login":"devkral","id":658768,"avatar_url":"https://avatars0.githubusercontent.com/u/658768?v=4","gravatar_id":"","url":"https://api.github.com/users/devkral","html_url":"https://github.com/devkral","followers_url":"https://api.github.com/users/devkral/followers","following_url":"https://api.github.com/users/devkral/following{/other_user}","gists_url":"https://api.github.com/users/devkral/gists{/gist_id}","starred_url":"https://api.github.com/users/devkral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devkral/subscriptions","organizations_url":"https://api.github.com/users/devkral/orgs","repos_url":"https://api.github.com/users/devkral/repos","events_url":"https://api.github.com/users/devkral/events{/privacy}","received_events_url":"https://api.github.com/users/devkral/received_events","type":"User","site_admin":false},"body":"Adds pam authentication to diaspora. Based on my patches to mastodon.\r\nFor people requiring ldap authentication:\r\nI wrote a package for pam which extracts the email from ldap:\r\nhttps://github.com/devkral/pam_email_extractor\r\n\r\nNot tested yet => WIP.","created_at":"2018-03-02T15:17:48Z","updated_at":"2018-03-29T11:55:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3f63afaa0b3e8cc1ffa1c735ab41687a7faf531","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":133815994,"url":"https://api.github.com/repos/diaspora/diaspora/labels/needs%20discourse","name":"needs discourse","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/diaspora/diaspora/pulls/7728/commits","review_comments_url":"https://api.github.com/repos/diaspora/diaspora/pulls/7728/comments","review_comment_url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diaspora/diaspora/issues/7728/comments","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/b67b12c786ffca8884f42112b67d4d5d22729a25","head":{"label":"devkral:rpam2_dev","ref":"rpam2_dev","sha":"b67b12c786ffca8884f42112b67d4d5d22729a25","user":{"login":"devkral","id":658768,"avatar_url":"https://avatars0.githubusercontent.com/u/658768?v=4","gravatar_id":"","url":"https://api.github.com/users/devkral","html_url":"https://github.com/devkral","followers_url":"https://api.github.com/users/devkral/followers","following_url":"https://api.github.com/users/devkral/following{/other_user}","gists_url":"https://api.github.com/users/devkral/gists{/gist_id}","starred_url":"https://api.github.com/users/devkral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devkral/subscriptions","organizations_url":"https://api.github.com/users/devkral/orgs","repos_url":"https://api.github.com/users/devkral/repos","events_url":"https://api.github.com/users/devkral/events{/privacy}","received_events_url":"https://api.github.com/users/devkral/received_events","type":"User","site_admin":false},"repo":{"id":114127489,"name":"diaspora","full_name":"devkral/diaspora","owner":{"login":"devkral","id":658768,"avatar_url":"https://avatars0.githubusercontent.com/u/658768?v=4","gravatar_id":"","url":"https://api.github.com/users/devkral","html_url":"https://github.com/devkral","followers_url":"https://api.github.com/users/devkral/followers","following_url":"https://api.github.com/users/devkral/following{/other_user}","gists_url":"https://api.github.com/users/devkral/gists{/gist_id}","starred_url":"https://api.github.com/users/devkral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devkral/subscriptions","organizations_url":"https://api.github.com/users/devkral/orgs","repos_url":"https://api.github.com/users/devkral/repos","events_url":"https://api.github.com/users/devkral/events{/privacy}","received_events_url":"https://api.github.com/users/devkral/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devkral/diaspora","description":"A privacy-aware, distributed, open source social network.","fork":true,"url":"https://api.github.com/repos/devkral/diaspora","forks_url":"https://api.github.com/repos/devkral/diaspora/forks","keys_url":"https://api.github.com/repos/devkral/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devkral/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devkral/diaspora/teams","hooks_url":"https://api.github.com/repos/devkral/diaspora/hooks","issue_events_url":"https://api.github.com/repos/devkral/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/devkral/diaspora/events","assignees_url":"https://api.github.com/repos/devkral/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/devkral/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/devkral/diaspora/tags","blobs_url":"https://api.github.com/repos/devkral/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devkral/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devkral/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/devkral/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devkral/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/devkral/diaspora/languages","stargazers_url":"https://api.github.com/repos/devkral/diaspora/stargazers","contributors_url":"https://api.github.com/repos/devkral/diaspora/contributors","subscribers_url":"https://api.github.com/repos/devkral/diaspora/subscribers","subscription_url":"https://api.github.com/repos/devkral/diaspora/subscription","commits_url":"https://api.github.com/repos/devkral/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/devkral/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/devkral/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/devkral/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/devkral/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/devkral/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devkral/diaspora/merges","archive_url":"https://api.github.com/repos/devkral/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devkral/diaspora/downloads","issues_url":"https://api.github.com/repos/devkral/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/devkral/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/devkral/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/devkral/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devkral/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/devkral/diaspora/releases{/id}","deployments_url":"https://api.github.com/repos/devkral/diaspora/deployments","created_at":"2017-12-13T13:58:56Z","updated_at":"2018-03-27T11:53:51Z","pushed_at":"2018-03-27T16:21:42Z","git_url":"git://github.com/devkral/diaspora.git","ssh_url":"git@github.com:devkral/diaspora.git","clone_url":"https://github.com/devkral/diaspora.git","svn_url":"https://github.com/devkral/diaspora","homepage":"https://diasporafoundation.org/","size":104390,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"diaspora:develop","ref":"develop","sha":"c84411ea624ed98938a516e2dcdea5b236f0656e","user":{"login":"diaspora","id":293207,"avatar_url":"https://avatars3.githubusercontent.com/u/293207?v=4","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://avatars3.githubusercontent.com/u/293207?v=4","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":"A privacy-aware, distributed, open source social network.","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}","deployments_url":"https://api.github.com/repos/diaspora/diaspora/deployments","created_at":"2010-09-15T05:20:04Z","updated_at":"2018-03-29T07:17:50Z","pushed_at":"2018-03-29T09:47:19Z","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":104339,"stargazers_count":11722,"watchers_count":11722,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2891,"mirror_url":null,"archived":false,"open_issues_count":408,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2891,"open_issues":408,"watchers":11722,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7728"},"html":{"href":"https://github.com/diaspora/diaspora/pull/7728"},"issue":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/7728"},"comments":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/7728/comments"},"review_comments":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7728/comments"},"review_comment":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7728/commits"},"statuses":{"href":"https://api.github.com/repos/diaspora/diaspora/statuses/b67b12c786ffca8884f42112b67d4d5d22729a25"}},"author_association":"NONE"}}
{"actor":{"display_login":"diaspora-code-review"}}