{"action":"closed","number":230,"pull_request":{"url":"https://api.github.com/repos/lotus/model/pulls/230","id":42708999,"html_url":"https://github.com/lotus/model/pull/230","diff_url":"https://github.com/lotus/model/pull/230.diff","patch_url":"https://github.com/lotus/model/pull/230.patch","issue_url":"https://api.github.com/repos/lotus/model/issues/230","number":230,"state":"closed","locked":false,"title":"Adds simple BCrypt secure passwords","user":{"login":"benlovell","id":41963,"avatar_url":"https://avatars.githubusercontent.com/u/41963?v=3","gravatar_id":"","url":"https://api.github.com/users/benlovell","html_url":"https://github.com/benlovell","followers_url":"https://api.github.com/users/benlovell/followers","following_url":"https://api.github.com/users/benlovell/following{/other_user}","gists_url":"https://api.github.com/users/benlovell/gists{/gist_id}","starred_url":"https://api.github.com/users/benlovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlovell/subscriptions","organizations_url":"https://api.github.com/users/benlovell/orgs","repos_url":"https://api.github.com/users/benlovell/repos","events_url":"https://api.github.com/users/benlovell/events{/privacy}","received_events_url":"https://api.github.com/users/benlovell/received_events","type":"User","site_admin":false},"body":"Includes basic validation for password and confirmation. Ensures\r\npasswords are kept below 72 characters, the theoretical maximum\r\npermitted by bcrypt's hashing function.\r\n\r\nI hit some troubles with Lotus validations. It was a surprise for me to\r\nfind that the validator macro creates accessors/attributes. It would\r\nhave been tidier to include a module containing the instance methods\r\nwithin the `included` callback, but due to ordering with the attributes\r\nAPI, and my need to overload the `password=` accessor _after_ it had\r\nbeen defined by the attributes API.\r\n\r\nBecause I wanted to use the confirmation, and the `size` validators\r\nthis pushed me toward that particular approach.\r\n\r\nSome things to note:\r\n\r\n* BCrypt is latently loaded and needs to be present in the Gemfile,\r\n this will be documented of course.\r\n* No efforts were made to abstract access to BCrypt since it's just the\r\n defacto approach/library. Happy to do this though if anyone feels\r\n strongly.\r\n* At the moment, the hashing cost is whatever BCrypt's default is. This\r\n can be overridden via `BCrypt::Engine.cost=`. It may be worth\r\n providing a nicer API here for consumers.\r\n\r\nI just wanted to get some validation on the approach before I\r\ndocumented the code. WDYT?","created_at":"2015-08-18T15:01:10Z","updated_at":"2015-09-09T06:08:03Z","closed_at":"2015-09-09T06:08:03Z","merged_at":null,"merge_commit_sha":"3e22d69a26737030b5ddcb5a674ef8f9efe093c0","assignee":{"login":"joneslee85","id":135605,"avatar_url":"https://avatars.githubusercontent.com/u/135605?v=3","gravatar_id":"","url":"https://api.github.com/users/joneslee85","html_url":"https://github.com/joneslee85","followers_url":"https://api.github.com/users/joneslee85/followers","following_url":"https://api.github.com/users/joneslee85/following{/other_user}","gists_url":"https://api.github.com/users/joneslee85/gists{/gist_id}","starred_url":"https://api.github.com/users/joneslee85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joneslee85/subscriptions","organizations_url":"https://api.github.com/users/joneslee85/orgs","repos_url":"https://api.github.com/users/joneslee85/repos","events_url":"https://api.github.com/users/joneslee85/events{/privacy}","received_events_url":"https://api.github.com/users/joneslee85/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/lotus/model/pulls/230/commits","review_comments_url":"https://api.github.com/repos/lotus/model/pulls/230/comments","review_comment_url":"https://api.github.com/repos/lotus/model/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lotus/model/issues/230/comments","statuses_url":"https://api.github.com/repos/lotus/model/statuses/3e9e6831f5998918131c7f4591671fd6df3b034d","head":{"label":"benlovell:secure-passwords","ref":"secure-passwords","sha":"3e9e6831f5998918131c7f4591671fd6df3b034d","user":{"login":"benlovell","id":41963,"avatar_url":"https://avatars.githubusercontent.com/u/41963?v=3","gravatar_id":"","url":"https://api.github.com/users/benlovell","html_url":"https://github.com/benlovell","followers_url":"https://api.github.com/users/benlovell/followers","following_url":"https://api.github.com/users/benlovell/following{/other_user}","gists_url":"https://api.github.com/users/benlovell/gists{/gist_id}","starred_url":"https://api.github.com/users/benlovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlovell/subscriptions","organizations_url":"https://api.github.com/users/benlovell/orgs","repos_url":"https://api.github.com/users/benlovell/repos","events_url":"https://api.github.com/users/benlovell/events{/privacy}","received_events_url":"https://api.github.com/users/benlovell/received_events","type":"User","site_admin":false},"repo":{"id":40730981,"name":"model","full_name":"benlovell/model","owner":{"login":"benlovell","id":41963,"avatar_url":"https://avatars.githubusercontent.com/u/41963?v=3","gravatar_id":"","url":"https://api.github.com/users/benlovell","html_url":"https://github.com/benlovell","followers_url":"https://api.github.com/users/benlovell/followers","following_url":"https://api.github.com/users/benlovell/following{/other_user}","gists_url":"https://api.github.com/users/benlovell/gists{/gist_id}","starred_url":"https://api.github.com/users/benlovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlovell/subscriptions","organizations_url":"https://api.github.com/users/benlovell/orgs","repos_url":"https://api.github.com/users/benlovell/repos","events_url":"https://api.github.com/users/benlovell/events{/privacy}","received_events_url":"https://api.github.com/users/benlovell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benlovell/model","description":"A persistence framework with entities, repositories, data mapper and query objects","fork":true,"url":"https://api.github.com/repos/benlovell/model","forks_url":"https://api.github.com/repos/benlovell/model/forks","keys_url":"https://api.github.com/repos/benlovell/model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benlovell/model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benlovell/model/teams","hooks_url":"https://api.github.com/repos/benlovell/model/hooks","issue_events_url":"https://api.github.com/repos/benlovell/model/issues/events{/number}","events_url":"https://api.github.com/repos/benlovell/model/events","assignees_url":"https://api.github.com/repos/benlovell/model/assignees{/user}","branches_url":"https://api.github.com/repos/benlovell/model/branches{/branch}","tags_url":"https://api.github.com/repos/benlovell/model/tags","blobs_url":"https://api.github.com/repos/benlovell/model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benlovell/model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benlovell/model/git/refs{/sha}","trees_url":"https://api.github.com/repos/benlovell/model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benlovell/model/statuses/{sha}","languages_url":"https://api.github.com/repos/benlovell/model/languages","stargazers_url":"https://api.github.com/repos/benlovell/model/stargazers","contributors_url":"https://api.github.com/repos/benlovell/model/contributors","subscribers_url":"https://api.github.com/repos/benlovell/model/subscribers","subscription_url":"https://api.github.com/repos/benlovell/model/subscription","commits_url":"https://api.github.com/repos/benlovell/model/commits{/sha}","git_commits_url":"https://api.github.com/repos/benlovell/model/git/commits{/sha}","comments_url":"https://api.github.com/repos/benlovell/model/comments{/number}","issue_comment_url":"https://api.github.com/repos/benlovell/model/issues/comments{/number}","contents_url":"https://api.github.com/repos/benlovell/model/contents/{+path}","compare_url":"https://api.github.com/repos/benlovell/model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benlovell/model/merges","archive_url":"https://api.github.com/repos/benlovell/model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benlovell/model/downloads","issues_url":"https://api.github.com/repos/benlovell/model/issues{/number}","pulls_url":"https://api.github.com/repos/benlovell/model/pulls{/number}","milestones_url":"https://api.github.com/repos/benlovell/model/milestones{/number}","notifications_url":"https://api.github.com/repos/benlovell/model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benlovell/model/labels{/name}","releases_url":"https://api.github.com/repos/benlovell/model/releases{/id}","created_at":"2015-08-14T18:47:46Z","updated_at":"2015-08-14T18:47:46Z","pushed_at":"2015-08-24T17:19:03Z","git_url":"git://github.com/benlovell/model.git","ssh_url":"git@github.com:benlovell/model.git","clone_url":"https://github.com/benlovell/model.git","svn_url":"https://github.com/benlovell/model","homepage":"","size":792,"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":"master"}},"base":{"label":"lotus:master","ref":"master","sha":"b1ecd810b023f43b1974f77c2ad90bb87ed1df72","user":{"login":"lotus","id":3210273,"avatar_url":"https://avatars.githubusercontent.com/u/3210273?v=3","gravatar_id":"","url":"https://api.github.com/users/lotus","html_url":"https://github.com/lotus","followers_url":"https://api.github.com/users/lotus/followers","following_url":"https://api.github.com/users/lotus/following{/other_user}","gists_url":"https://api.github.com/users/lotus/gists{/gist_id}","starred_url":"https://api.github.com/users/lotus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lotus/subscriptions","organizations_url":"https://api.github.com/users/lotus/orgs","repos_url":"https://api.github.com/users/lotus/repos","events_url":"https://api.github.com/users/lotus/events{/privacy}","received_events_url":"https://api.github.com/users/lotus/received_events","type":"Organization","site_admin":false},"repo":{"id":16760719,"name":"model","full_name":"lotus/model","owner":{"login":"lotus","id":3210273,"avatar_url":"https://avatars.githubusercontent.com/u/3210273?v=3","gravatar_id":"","url":"https://api.github.com/users/lotus","html_url":"https://github.com/lotus","followers_url":"https://api.github.com/users/lotus/followers","following_url":"https://api.github.com/users/lotus/following{/other_user}","gists_url":"https://api.github.com/users/lotus/gists{/gist_id}","starred_url":"https://api.github.com/users/lotus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lotus/subscriptions","organizations_url":"https://api.github.com/users/lotus/orgs","repos_url":"https://api.github.com/users/lotus/repos","events_url":"https://api.github.com/users/lotus/events{/privacy}","received_events_url":"https://api.github.com/users/lotus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lotus/model","description":"A persistence framework with entities, repositories, data mapper and query objects","fork":false,"url":"https://api.github.com/repos/lotus/model","forks_url":"https://api.github.com/repos/lotus/model/forks","keys_url":"https://api.github.com/repos/lotus/model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lotus/model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lotus/model/teams","hooks_url":"https://api.github.com/repos/lotus/model/hooks","issue_events_url":"https://api.github.com/repos/lotus/model/issues/events{/number}","events_url":"https://api.github.com/repos/lotus/model/events","assignees_url":"https://api.github.com/repos/lotus/model/assignees{/user}","branches_url":"https://api.github.com/repos/lotus/model/branches{/branch}","tags_url":"https://api.github.com/repos/lotus/model/tags","blobs_url":"https://api.github.com/repos/lotus/model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lotus/model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lotus/model/git/refs{/sha}","trees_url":"https://api.github.com/repos/lotus/model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lotus/model/statuses/{sha}","languages_url":"https://api.github.com/repos/lotus/model/languages","stargazers_url":"https://api.github.com/repos/lotus/model/stargazers","contributors_url":"https://api.github.com/repos/lotus/model/contributors","subscribers_url":"https://api.github.com/repos/lotus/model/subscribers","subscription_url":"https://api.github.com/repos/lotus/model/subscription","commits_url":"https://api.github.com/repos/lotus/model/commits{/sha}","git_commits_url":"https://api.github.com/repos/lotus/model/git/commits{/sha}","comments_url":"https://api.github.com/repos/lotus/model/comments{/number}","issue_comment_url":"https://api.github.com/repos/lotus/model/issues/comments{/number}","contents_url":"https://api.github.com/repos/lotus/model/contents/{+path}","compare_url":"https://api.github.com/repos/lotus/model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lotus/model/merges","archive_url":"https://api.github.com/repos/lotus/model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lotus/model/downloads","issues_url":"https://api.github.com/repos/lotus/model/issues{/number}","pulls_url":"https://api.github.com/repos/lotus/model/pulls{/number}","milestones_url":"https://api.github.com/repos/lotus/model/milestones{/number}","notifications_url":"https://api.github.com/repos/lotus/model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lotus/model/labels{/name}","releases_url":"https://api.github.com/repos/lotus/model/releases{/id}","created_at":"2014-02-12T08:25:42Z","updated_at":"2015-09-08T13:24:14Z","pushed_at":"2015-09-06T11:03:49Z","git_url":"git://github.com/lotus/model.git","ssh_url":"git@github.com:lotus/model.git","clone_url":"https://github.com/lotus/model.git","svn_url":"https://github.com/lotus/model","homepage":"","size":2540,"stargazers_count":226,"watchers_count":226,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":87,"mirror_url":null,"open_issues_count":16,"forks":87,"open_issues":16,"watchers":226,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lotus/model/pulls/230"},"html":{"href":"https://github.com/lotus/model/pull/230"},"issue":{"href":"https://api.github.com/repos/lotus/model/issues/230"},"comments":{"href":"https://api.github.com/repos/lotus/model/issues/230/comments"},"review_comments":{"href":"https://api.github.com/repos/lotus/model/pulls/230/comments"},"review_comment":{"href":"https://api.github.com/repos/lotus/model/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lotus/model/pulls/230/commits"},"statuses":{"href":"https://api.github.com/repos/lotus/model/statuses/3e9e6831f5998918131c7f4591671fd6df3b034d"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":119,"deletions":0,"changed_files":4}}