{"action":"created","comment":{"url":"https://api.github.com/repos/heapsource/active_model_otp/pulls/comments/24620355","id":24620355,"diff_hunk":"@@ -5,20 +5,23 @@ module OneTimePassword\n     module ClassMethods\n \n       def has_one_time_password(options = {})\n-\n-        cattr_accessor :otp_column_name\n-        class_attribute :otp_digits\n+        cattr_accessor :otp_column_name, :otp_counter_column_name\n+        class_attribute :otp_digits, :otp_counter_based\n \n         self.otp_column_name = (options[:column_name] || \"otp_secret_key\").to_s\n         self.otp_digits = options[:length] || 6\n \n+        self.otp_counter_based = (options[:counter_based] || false)\n+        self.otp_counter_column_name = (options[:counter_column_name] || \"otp_counter\").to_s","path":"lib/active_model/one_time_password.rb","position":14,"original_position":14,"commit_id":"843f3ba2b1dd77f383e06332de59b8f60434f8fc","original_commit_id":"843f3ba2b1dd77f383e06332de59b8f60434f8fc","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. [92/80]","created_at":"2015-02-12T21:09:25Z","updated_at":"2015-02-12T21:09:25Z","html_url":"https://github.com/heapsource/active_model_otp/pull/19#discussion_r24620355","pull_request_url":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/heapsource/active_model_otp/pulls/comments/24620355"},"html":{"href":"https://github.com/heapsource/active_model_otp/pull/19#discussion_r24620355"},"pull_request":{"href":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19","id":29216317,"html_url":"https://github.com/heapsource/active_model_otp/pull/19","diff_url":"https://github.com/heapsource/active_model_otp/pull/19.diff","patch_url":"https://github.com/heapsource/active_model_otp/pull/19.patch","issue_url":"https://api.github.com/repos/heapsource/active_model_otp/issues/19","number":19,"state":"open","locked":false,"title":"Added Counter based OTP (HOTP)","user":{"login":"ResultsMayVary","id":5660808,"avatar_url":"https://avatars.githubusercontent.com/u/5660808?v=3","gravatar_id":"","url":"https://api.github.com/users/ResultsMayVary","html_url":"https://github.com/ResultsMayVary","followers_url":"https://api.github.com/users/ResultsMayVary/followers","following_url":"https://api.github.com/users/ResultsMayVary/following{/other_user}","gists_url":"https://api.github.com/users/ResultsMayVary/gists{/gist_id}","starred_url":"https://api.github.com/users/ResultsMayVary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ResultsMayVary/subscriptions","organizations_url":"https://api.github.com/users/ResultsMayVary/orgs","repos_url":"https://api.github.com/users/ResultsMayVary/repos","events_url":"https://api.github.com/users/ResultsMayVary/events{/privacy}","received_events_url":"https://api.github.com/users/ResultsMayVary/received_events","type":"User","site_admin":false},"body":"For my project I required a counter based solution. I've expanded this to support the counter_based flag to allow HOTP. It's been tested in my environment and is working as expected. Readme has been updated with usage instructions as well as the version number increase to v1.2.0.\r\n\r\nLet me know if this is all good and if you want me to perform any other changes before pulling. Thanks!","created_at":"2015-02-12T21:09:20Z","updated_at":"2015-02-12T21:09:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"383b494da1aa2791030c359bc3e45ca1f52869c0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19/commits","review_comments_url":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19/comments","review_comment_url":"https://api.github.com/repos/heapsource/active_model_otp/pulls/comments/{number}","comments_url":"https://api.github.com/repos/heapsource/active_model_otp/issues/19/comments","statuses_url":"https://api.github.com/repos/heapsource/active_model_otp/statuses/843f3ba2b1dd77f383e06332de59b8f60434f8fc","head":{"label":"ResultsMayVary:add_counter_based_auth","ref":"add_counter_based_auth","sha":"843f3ba2b1dd77f383e06332de59b8f60434f8fc","user":{"login":"ResultsMayVary","id":5660808,"avatar_url":"https://avatars.githubusercontent.com/u/5660808?v=3","gravatar_id":"","url":"https://api.github.com/users/ResultsMayVary","html_url":"https://github.com/ResultsMayVary","followers_url":"https://api.github.com/users/ResultsMayVary/followers","following_url":"https://api.github.com/users/ResultsMayVary/following{/other_user}","gists_url":"https://api.github.com/users/ResultsMayVary/gists{/gist_id}","starred_url":"https://api.github.com/users/ResultsMayVary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ResultsMayVary/subscriptions","organizations_url":"https://api.github.com/users/ResultsMayVary/orgs","repos_url":"https://api.github.com/users/ResultsMayVary/repos","events_url":"https://api.github.com/users/ResultsMayVary/events{/privacy}","received_events_url":"https://api.github.com/users/ResultsMayVary/received_events","type":"User","site_admin":false},"repo":{"id":30542260,"name":"active_model_otp","full_name":"ResultsMayVary/active_model_otp","owner":{"login":"ResultsMayVary","id":5660808,"avatar_url":"https://avatars.githubusercontent.com/u/5660808?v=3","gravatar_id":"","url":"https://api.github.com/users/ResultsMayVary","html_url":"https://github.com/ResultsMayVary","followers_url":"https://api.github.com/users/ResultsMayVary/followers","following_url":"https://api.github.com/users/ResultsMayVary/following{/other_user}","gists_url":"https://api.github.com/users/ResultsMayVary/gists{/gist_id}","starred_url":"https://api.github.com/users/ResultsMayVary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ResultsMayVary/subscriptions","organizations_url":"https://api.github.com/users/ResultsMayVary/orgs","repos_url":"https://api.github.com/users/ResultsMayVary/repos","events_url":"https://api.github.com/users/ResultsMayVary/events{/privacy}","received_events_url":"https://api.github.com/users/ResultsMayVary/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ResultsMayVary/active_model_otp","description":"Adds methods to set and authenticate against one time passwords (Two-Factor Authentication). Inspired in AM::SecurePassword. Forked to support counter based OTP (HOTP)","fork":true,"url":"https://api.github.com/repos/ResultsMayVary/active_model_otp","forks_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/forks","keys_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/teams","hooks_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/hooks","issue_events_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/issues/events{/number}","events_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/events","assignees_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/assignees{/user}","branches_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/branches{/branch}","tags_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/tags","blobs_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/statuses/{sha}","languages_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/languages","stargazers_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/stargazers","contributors_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/contributors","subscribers_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/subscribers","subscription_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/subscription","commits_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/issues/comments/{number}","contents_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/contents/{+path}","compare_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/merges","archive_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/downloads","issues_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/issues{/number}","pulls_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/pulls{/number}","milestones_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/milestones{/number}","notifications_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/labels{/name}","releases_url":"https://api.github.com/repos/ResultsMayVary/active_model_otp/releases{/id}","created_at":"2015-02-09T15:22:58Z","updated_at":"2015-02-12T21:04:19Z","pushed_at":"2015-02-12T21:04:19Z","git_url":"git://github.com/ResultsMayVary/active_model_otp.git","ssh_url":"git@github.com:ResultsMayVary/active_model_otp.git","clone_url":"https://github.com/ResultsMayVary/active_model_otp.git","svn_url":"https://github.com/ResultsMayVary/active_model_otp","homepage":"","size":130,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"add_counter_based_auth"}},"base":{"label":"heapsource:master","ref":"master","sha":"080541084bc89125a5ea2e91f0b61c2ff3d7de3f","user":{"login":"heapsource","id":4326101,"avatar_url":"https://avatars.githubusercontent.com/u/4326101?v=3","gravatar_id":"","url":"https://api.github.com/users/heapsource","html_url":"https://github.com/heapsource","followers_url":"https://api.github.com/users/heapsource/followers","following_url":"https://api.github.com/users/heapsource/following{/other_user}","gists_url":"https://api.github.com/users/heapsource/gists{/gist_id}","starred_url":"https://api.github.com/users/heapsource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heapsource/subscriptions","organizations_url":"https://api.github.com/users/heapsource/orgs","repos_url":"https://api.github.com/users/heapsource/repos","events_url":"https://api.github.com/users/heapsource/events{/privacy}","received_events_url":"https://api.github.com/users/heapsource/received_events","type":"Organization","site_admin":false},"repo":{"id":9255015,"name":"active_model_otp","full_name":"heapsource/active_model_otp","owner":{"login":"heapsource","id":4326101,"avatar_url":"https://avatars.githubusercontent.com/u/4326101?v=3","gravatar_id":"","url":"https://api.github.com/users/heapsource","html_url":"https://github.com/heapsource","followers_url":"https://api.github.com/users/heapsource/followers","following_url":"https://api.github.com/users/heapsource/following{/other_user}","gists_url":"https://api.github.com/users/heapsource/gists{/gist_id}","starred_url":"https://api.github.com/users/heapsource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heapsource/subscriptions","organizations_url":"https://api.github.com/users/heapsource/orgs","repos_url":"https://api.github.com/users/heapsource/repos","events_url":"https://api.github.com/users/heapsource/events{/privacy}","received_events_url":"https://api.github.com/users/heapsource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heapsource/active_model_otp","description":"Adds methods to set and authenticate against one time passwords (Two-Factor Authentication). Inspired in AM::SecurePassword ","fork":false,"url":"https://api.github.com/repos/heapsource/active_model_otp","forks_url":"https://api.github.com/repos/heapsource/active_model_otp/forks","keys_url":"https://api.github.com/repos/heapsource/active_model_otp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heapsource/active_model_otp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heapsource/active_model_otp/teams","hooks_url":"https://api.github.com/repos/heapsource/active_model_otp/hooks","issue_events_url":"https://api.github.com/repos/heapsource/active_model_otp/issues/events{/number}","events_url":"https://api.github.com/repos/heapsource/active_model_otp/events","assignees_url":"https://api.github.com/repos/heapsource/active_model_otp/assignees{/user}","branches_url":"https://api.github.com/repos/heapsource/active_model_otp/branches{/branch}","tags_url":"https://api.github.com/repos/heapsource/active_model_otp/tags","blobs_url":"https://api.github.com/repos/heapsource/active_model_otp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heapsource/active_model_otp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heapsource/active_model_otp/git/refs{/sha}","trees_url":"https://api.github.com/repos/heapsource/active_model_otp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heapsource/active_model_otp/statuses/{sha}","languages_url":"https://api.github.com/repos/heapsource/active_model_otp/languages","stargazers_url":"https://api.github.com/repos/heapsource/active_model_otp/stargazers","contributors_url":"https://api.github.com/repos/heapsource/active_model_otp/contributors","subscribers_url":"https://api.github.com/repos/heapsource/active_model_otp/subscribers","subscription_url":"https://api.github.com/repos/heapsource/active_model_otp/subscription","commits_url":"https://api.github.com/repos/heapsource/active_model_otp/commits{/sha}","git_commits_url":"https://api.github.com/repos/heapsource/active_model_otp/git/commits{/sha}","comments_url":"https://api.github.com/repos/heapsource/active_model_otp/comments{/number}","issue_comment_url":"https://api.github.com/repos/heapsource/active_model_otp/issues/comments/{number}","contents_url":"https://api.github.com/repos/heapsource/active_model_otp/contents/{+path}","compare_url":"https://api.github.com/repos/heapsource/active_model_otp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heapsource/active_model_otp/merges","archive_url":"https://api.github.com/repos/heapsource/active_model_otp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heapsource/active_model_otp/downloads","issues_url":"https://api.github.com/repos/heapsource/active_model_otp/issues{/number}","pulls_url":"https://api.github.com/repos/heapsource/active_model_otp/pulls{/number}","milestones_url":"https://api.github.com/repos/heapsource/active_model_otp/milestones{/number}","notifications_url":"https://api.github.com/repos/heapsource/active_model_otp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heapsource/active_model_otp/labels{/name}","releases_url":"https://api.github.com/repos/heapsource/active_model_otp/releases{/id}","created_at":"2013-04-06T03:51:01Z","updated_at":"2015-02-11T11:49:26Z","pushed_at":"2014-12-09T07:18:53Z","git_url":"git://github.com/heapsource/active_model_otp.git","ssh_url":"git@github.com:heapsource/active_model_otp.git","clone_url":"https://github.com/heapsource/active_model_otp.git","svn_url":"https://github.com/heapsource/active_model_otp","homepage":"","size":800,"stargazers_count":181,"watchers_count":181,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":3,"forks":22,"open_issues":3,"watchers":181,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19"},"html":{"href":"https://github.com/heapsource/active_model_otp/pull/19"},"issue":{"href":"https://api.github.com/repos/heapsource/active_model_otp/issues/19"},"comments":{"href":"https://api.github.com/repos/heapsource/active_model_otp/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/heapsource/active_model_otp/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/heapsource/active_model_otp/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/heapsource/active_model_otp/statuses/843f3ba2b1dd77f383e06332de59b8f60434f8fc"}}}}