devise_google_authenticator 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjBmNWJmYjg3Yzk3NWE4ZmU1Njg1OTYyOTEwODE0MzUxMDU0ODBjMg==
4
+ NzhiNGE3NDNkMWZlZTMzY2RiMTJlNDYwMGIwNjg0NTE0YjBkMWYxMg==
5
5
  data.tar.gz: !binary |-
6
- ZDNmNDMwNmQ2ZjgzOTYyNmRlMjY0Y2ZjZGFlNWRiM2QzNmRiOGJhNg==
6
+ YTIyN2E0YTVjNjI2NWE0NzRmOGJkMTBlNjYzM2YzMTk2NWJiNjI1OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTdhZGZmZmFhYjEyMzk3NDEwYmU0ODlhNWViMzQ2MTI4YzA4ZjllNmMxYzhk
10
- Y2VlMDNmOTM0NTQ5ZmQ5M2Y5OWMyYjFmNzg0MTVjZWM3MTVlOTMyNWVjMDI0
11
- NTI0NzUyN2RmYmViMWNlZDQ0OWIzYzNiY2NjNTBjOTdkYjc1NTI=
9
+ NjBkY2YxNTJjOWVmNTFhMmVmNmNmYTc1N2QxNDZmNTQ4Nzk5MDc0NTZkYmM2
10
+ N2ZiNjZmMDc4MzEzZjExZjkyODg5Njk2ZTNiNThiMDU1YWViNjlmNTg1MGZh
11
+ NmYyMDIwNWFlNWU3Y2NkOTYxYTdmZjk5OTBhYjVmOTAwMjRjMWU=
12
12
  data.tar.gz: !binary |-
13
- ZTk2MTk2ODA1YzJkM2E0ZDY5ZmM1YTNhOGJlZTM0ZDZjYjYzNWY1YzUzNzg4
14
- OWI3Y2U4MDMxN2MwNDg3MTJmM2JkNjI4MzdkOTdhMDcxY2I5ZDNmZTVhYjE3
15
- MDE4NmNkODBkNTg4MmMyMDkyZjhkNGRmNjQxMzY5OTQxYTlkMWE=
13
+ OWFiZDhhZDNjNTUzZDNkNzVmODAwYmI3ZjIyZmM2ZDkyNGZjM2Y2ZDcxMGMx
14
+ NWM1OTE0MjY4MjRjZWUzOWIzYzAzODk3MTRlZGQ0MjA5ZGVlNzJjZjU5ODY0
15
+ ZDEwYWNhNTUwMmFlZGEyMGE3N2NhOTA2Zjg2YjFiN2I3OTY2NDk=
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Christian Frichot
1
+ Copyright (c) 2014 Christian Frichot
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -14,13 +14,14 @@ This is a devise[https://github.com/plataformatec/devise] extension to allow you
14
14
  * Version 0.3.6 - Slight updates - increased key size, more open gemspec, updated en.yml. (Thanks Michael Guymon)
15
15
  * Version 0.3.7 - Support for current Devise (3.2.0) and Rails4 (Thanks https://github.com/ronald05arias) - integration test still broke - need to address this
16
16
  * Version 0.3.8 - Support for remembering the token authentication. (i.e. don't request the token for a configurable amount of time Thanks https://github.com/blahblahblah-) - and seriously, I'm going to try and refactor all the integration tests with Rspec.
17
+ * Version 0.3.9 - Merging fix from zhenyuchen (deprecated ActiveRecord query grammar) - also, re-tested against Rails 4.0.4 and Devise 3.2.3
17
18
 
18
19
  == Installation
19
20
 
20
21
  Add the gem to your Gemfile (don't forget devise too):
21
22
 
22
23
  * gem 'devise'
23
- * gem 'devise_google_authenticator', '0.3.8'
24
+ * gem 'devise_google_authenticator', '0.3.9'
24
25
 
25
26
  Don't forget to "bundle install"
26
27
 
@@ -70,6 +71,7 @@ The install generator adds some options to the end of your Devise config file (c
70
71
 
71
72
  * config.ga_timeout - how long should the user be able to authenticate with their Google Authenticator token
72
73
  * config.ga_timedrift - a multiplier which provides for drift between a user's clock (and therefore their OTP) and the system clock. This should be fine at 3.
74
+ * config.ga_remembertime - how long to remember the token for before requiring another. By default this is 1 month. To disable this setting change it to nil.
73
75
 
74
76
  == Custom Views
75
77
 
@@ -84,6 +86,7 @@ With this extension enabled, the following is expected behaviour:
84
86
  * When a user registers, they are forwarded onto the Display QR page. This allows them to add their new "token" to their mobile device, and enable, or disable, the functionality.
85
87
  * If users can't self-register, they're still able to visit this page by visiting /MODEL/displayqr (eg: /users/displayqr).
86
88
  * If the function is enabled (for that user), when they sign in, they'll be prompted for their password (as per normal), but then redirected into the Check QR page. They have to enter their token (from their device) to then successfully authenticate.
89
+ * If configured (by default to 1 month), the user will only be prompted for the token every 1 month.
87
90
 
88
91
  == I18n
89
92
 
@@ -97,6 +100,8 @@ This extension would not exist without the following other projects and associat
97
100
  * Devise_invitable (Sergio Cambra) https://github.com/scambra/devise_invitable
98
101
  * Devise_openid_authenticatable (Nat Budin) https://github.com/nbudin/devise_openid_authenticatable
99
102
  * Devise_security_extension (Team Phatworx, Marco Scholl, Alexander Dreher) https://github.com/phatworx/devise_security_extension
103
+ * Ronald Arias https://github.com/ronald05arias
104
+ * Sunny Ng https://github.com/blahblahblah-
100
105
 
101
106
 
102
107
  == Contributing to devise_google_authenticator
@@ -111,6 +116,6 @@ This extension would not exist without the following other projects and associat
111
116
 
112
117
  == Copyright
113
118
 
114
- Copyright (c) 2012 Christian Frichot. See LICENSE.txt for
119
+ Copyright (c) 2014 Christian Frichot. See LICENSE.txt for
115
120
  further details.
116
121
 
@@ -72,7 +72,7 @@ module Devise # :nodoc:
72
72
 
73
73
  module ClassMethods # :nodoc:
74
74
  def find_by_gauth_tmp(gauth_tmp)
75
- find(:first, :conditions => {:gauth_tmp => gauth_tmp})
75
+ where(gauth_tmp: gauth_tmp).first
76
76
  end
77
77
  ::Devise::Models.config(self, :ga_timeout, :ga_timedrift, :ga_remembertime)
78
78
  end
@@ -6,7 +6,7 @@ module ActiveRecord
6
6
  source_root File.expand_path("../templates", __FILE__)
7
7
 
8
8
  def copy_devise_migration
9
- migration_template "migration.rb", "db/migrate/devise_google_authenticator_add_to_#{table_name}"
9
+ migration_template "migration.rb", "db/migrate/devise_google_authenticator_add_to_#{table_name}.rb"
10
10
  end
11
11
  end
12
12
  end
@@ -1,26 +1,26 @@
1
1
  module DeviseGoogleAuthenticator
2
- module Generators
3
- class DeviseGoogleAuthenticatorGenerator < Rails::Generators::NamedBase
2
+ module Generators
3
+ class DeviseGoogleAuthenticatorGenerator < Rails::Generators::NamedBase
4
4
 
5
- namespace "devise_google_authenticator"
5
+ namespace "devise_google_authenticator"
6
6
 
7
- desc "Add :google_authenticatable directive in the given model, plus accessors. Also generate migration for ActiveRecord"
7
+ desc "Add :google_authenticatable directive in the given model, plus accessors. Also generate migration for ActiveRecord"
8
8
 
9
- def inject_devise_google_authenticator_content
10
- path = File.join("app","models","#{file_path}.rb")
9
+ def inject_devise_google_authenticator_content
10
+ path = File.join("app","models","#{file_path}.rb")
11
11
 
12
- if File.exists?(path)
13
- inject_into_file(path, "google_authenticatable, :", :after => "devise :")
14
- inject_into_file(path, "gauth_enabled, :gauth_tmp, :gauth_tmp_datetime, :", :after => "attr_accessible :") if needs_attr_accessible?
15
- inject_into_class(path, class_name, "\tattr_accessor :gauth_token\n")
16
- end
17
- end
12
+ if File.exists?(path)
13
+ inject_into_file(path, "google_authenticatable, :", :after => "devise :")
14
+ inject_into_file(path, "gauth_enabled, :gauth_tmp, :gauth_tmp_datetime, :", :after => "attr_accessible :") if needs_attr_accessible?
15
+ inject_into_class(path, class_name, "\tattr_accessor :gauth_token\n")
16
+ end
17
+ end
18
18
 
19
- hook_for :orm
19
+ hook_for :orm
20
20
 
21
- private
21
+ private
22
22
 
23
- def needs_attr_accessible?
23
+ def needs_attr_accessible?
24
24
  rails_3? && !strong_parameters_enabled?
25
25
  end
26
26
 
@@ -32,6 +32,6 @@ module DeviseGoogleAuthenticator
32
32
  defined?(ActionController::StrongParameters)
33
33
  end
34
34
 
35
- end
36
- end
35
+ end
36
+ end
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_google_authenticator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Frichot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-29 00:00:00.000000000 Z
11
+ date: 2014-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler