google-authenticator-rails 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 258692fbcd739848ad81f173e797cb59ba5d781e
4
- data.tar.gz: f55e0f035fc69bbb9e9cb8b32b07dfe76a4c0314
3
+ metadata.gz: 733b5fa7a4a4a2170e01fb35327977bcd24e4124
4
+ data.tar.gz: 329d7ceadd0f62a05b041c29e7421642da541f24
5
5
  SHA512:
6
- metadata.gz: 4e8b07d17935c0517c7b6cd2b988cc680299952950891a36758803b751f28d5602391f0c480cb3de7ff6b8d2cf5668a412bff25666bfec7c9e71c63ef11821b8
7
- data.tar.gz: 3698e4f4ba7ab053dd21d85a0c318625e1bd47921e8c6e3d679babcea0c6045114758e7db80f3c9a97ff55b95a26ae5f983d6b22b315bbe78ab3f6397caeae4c
6
+ metadata.gz: 40d3ff09af1f128c571bda48c6dd786d4426abeaa00d412928e79c6fa6e0da68ee27ab17c4603c0bcf7d5304509c7fd5a56e52b279bf8f36b22334957cb0666c
7
+ data.tar.gz: ba4e6c720aedd121c10bb4ba7b2efd71768496ac308d43fd930a75733b703ae8e1a5ed764ac2bdeea7e2dbd6669f0ddc3326f08ec4de60cfec497041877b5d19
data/Appraisals CHANGED
@@ -24,6 +24,7 @@ end
24
24
  appraise "rails4.1" do
25
25
  gem "activerecord", "~> 4.1.0"
26
26
  gem "protected_attributes"
27
+ gem "json", "~> 1.8.3"
27
28
  end
28
29
 
29
30
  appraise "rails4.2" do
data/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ FROM ruby:2.3.1
2
+
3
+ RUN mkdir -p /var/app
4
+
5
+ COPY Gemfile /var/app/Gemfile
6
+ COPY Gemfile.lock /var/app/Gemfile.lock
7
+ COPY google-authenticator.gemspec /var/app/google-authenticator.gemspec
8
+ COPY lib/google-authenticator-rails/version.rb /var/app/lib/google-authenticator-rails/version.rb
9
+ COPY Rakefile /var/app/Rakefile
10
+ COPY gemfiles/*.gemfile /var/app/
11
+ WORKDIR /var/app
12
+
13
+ RUN gem install bundler --version=1.15.4 --no-ri --no-rdoc
14
+
15
+ RUN bundle install
16
+ RUN bundle exec rake appraisal:install
17
+
data/Gemfile.lock ADDED
@@ -0,0 +1,148 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ google-authenticator-rails (1.5.0)
5
+ actionpack
6
+ activerecord
7
+ google-qr
8
+ rails
9
+ rotp (= 1.6.1)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actioncable (5.1.5)
15
+ actionpack (= 5.1.5)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (~> 0.6.1)
18
+ actionmailer (5.1.5)
19
+ actionpack (= 5.1.5)
20
+ actionview (= 5.1.5)
21
+ activejob (= 5.1.5)
22
+ mail (~> 2.5, >= 2.5.4)
23
+ rails-dom-testing (~> 2.0)
24
+ actionpack (5.1.5)
25
+ actionview (= 5.1.5)
26
+ activesupport (= 5.1.5)
27
+ rack (~> 2.0)
28
+ rack-test (>= 0.6.3)
29
+ rails-dom-testing (~> 2.0)
30
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
+ actionview (5.1.5)
32
+ activesupport (= 5.1.5)
33
+ builder (~> 3.1)
34
+ erubi (~> 1.4)
35
+ rails-dom-testing (~> 2.0)
36
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
37
+ activejob (5.1.5)
38
+ activesupport (= 5.1.5)
39
+ globalid (>= 0.3.6)
40
+ activemodel (5.1.5)
41
+ activesupport (= 5.1.5)
42
+ activerecord (5.1.5)
43
+ activemodel (= 5.1.5)
44
+ activesupport (= 5.1.5)
45
+ arel (~> 8.0)
46
+ activesupport (5.1.5)
47
+ concurrent-ruby (~> 1.0, >= 1.0.2)
48
+ i18n (~> 0.7)
49
+ minitest (~> 5.1)
50
+ tzinfo (~> 1.1)
51
+ appraisal (0.5.2)
52
+ bundler
53
+ rake
54
+ arel (8.0.0)
55
+ builder (3.2.3)
56
+ concurrent-ruby (1.0.5)
57
+ crass (1.0.3)
58
+ diff-lcs (1.1.3)
59
+ docile (1.1.5)
60
+ erubi (1.7.0)
61
+ globalid (0.4.1)
62
+ activesupport (>= 4.2.0)
63
+ google-qr (0.2.2)
64
+ i18n (0.9.5)
65
+ concurrent-ruby (~> 1.0)
66
+ json (2.1.0)
67
+ loofah (2.2.0)
68
+ crass (~> 1.0.2)
69
+ nokogiri (>= 1.5.9)
70
+ mail (2.7.0)
71
+ mini_mime (>= 0.1.1)
72
+ method_source (0.9.0)
73
+ mini_mime (1.0.0)
74
+ mini_portile2 (2.3.0)
75
+ minitest (5.11.3)
76
+ nio4r (2.2.0)
77
+ nokogiri (1.8.2)
78
+ mini_portile2 (~> 2.3.0)
79
+ rack (2.0.4)
80
+ rack-test (0.8.2)
81
+ rack (>= 1.0, < 3)
82
+ rails (5.1.5)
83
+ actioncable (= 5.1.5)
84
+ actionmailer (= 5.1.5)
85
+ actionpack (= 5.1.5)
86
+ actionview (= 5.1.5)
87
+ activejob (= 5.1.5)
88
+ activemodel (= 5.1.5)
89
+ activerecord (= 5.1.5)
90
+ activesupport (= 5.1.5)
91
+ bundler (>= 1.3.0)
92
+ railties (= 5.1.5)
93
+ sprockets-rails (>= 2.0.0)
94
+ rails-dom-testing (2.0.3)
95
+ activesupport (>= 4.2.0)
96
+ nokogiri (>= 1.6)
97
+ rails-html-sanitizer (1.0.3)
98
+ loofah (~> 2.0)
99
+ railties (5.1.5)
100
+ actionpack (= 5.1.5)
101
+ activesupport (= 5.1.5)
102
+ method_source
103
+ rake (>= 0.8.7)
104
+ thor (>= 0.18.1, < 2.0)
105
+ rake (11.3.0)
106
+ rotp (1.6.1)
107
+ rspec (2.8.0)
108
+ rspec-core (~> 2.8.0)
109
+ rspec-expectations (~> 2.8.0)
110
+ rspec-mocks (~> 2.8.0)
111
+ rspec-core (2.8.0)
112
+ rspec-expectations (2.8.0)
113
+ diff-lcs (~> 1.1.2)
114
+ rspec-mocks (2.8.0)
115
+ simplecov (0.15.1)
116
+ docile (~> 1.1.0)
117
+ json (>= 1.8, < 3)
118
+ simplecov-html (~> 0.10.0)
119
+ simplecov-html (0.10.2)
120
+ sprockets (3.7.1)
121
+ concurrent-ruby (~> 1.0)
122
+ rack (> 1, < 3)
123
+ sprockets-rails (3.2.1)
124
+ actionpack (>= 4.0)
125
+ activesupport (>= 4.0)
126
+ sprockets (>= 3.0.0)
127
+ sqlite3 (1.3.13)
128
+ thor (0.20.0)
129
+ thread_safe (0.3.6)
130
+ tzinfo (1.2.5)
131
+ thread_safe (~> 0.1)
132
+ websocket-driver (0.6.5)
133
+ websocket-extensions (>= 0.1.0)
134
+ websocket-extensions (0.1.3)
135
+
136
+ PLATFORMS
137
+ ruby
138
+
139
+ DEPENDENCIES
140
+ appraisal (~> 0.5.1)
141
+ google-authenticator-rails!
142
+ rake (~> 11.0)
143
+ rspec (~> 2.8.0)
144
+ simplecov
145
+ sqlite3
146
+
147
+ BUNDLED WITH
148
+ 1.15.4
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/google-authenticator-rails.png)](http://badge.fury.io/rb/google-authenticator-rails)
4
4
  [![Build Status](https://secure.travis-ci.org/jaredonline/google-authenticator.png)](http://travis-ci.org/jaredonline/google-authenticator)
5
5
  [![Code Climate](https://codeclimate.com/github/jaredonline/google-authenticator.png)](https://codeclimate.com/github/jaredonline/google-authenticator)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/41e825da75bd7630262f/test_coverage)](https://codeclimate.com/github/jaredonline/google-authenticator/test_coverage)
6
7
 
7
8
  Rails (ActiveRecord) integration with the Google Authenticator apps for [Android](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) and the [iPhone](https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8). Uses the Authlogic style for cookie management.
8
9
 
@@ -1,7 +1,3 @@
1
- module Google
2
- module Authenticator
3
- module Rails
4
- VERSION = "1.4.1"
5
- end
6
- end
1
+ module GoogleAuthenticatorRails
2
+ VERSION = "1.5.0"
7
3
  end
data/spec/spec_helper.rb CHANGED
@@ -8,6 +8,9 @@ require 'rotp'
8
8
  require 'bundler'
9
9
  require 'bundler/setup'
10
10
 
11
+ require 'simplecov'
12
+ SimpleCov.start
13
+
11
14
  require 'google-authenticator-rails'
12
15
 
13
16
  class MockController
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-authenticator-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared McFarland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-14 00:00:00.000000000 Z
11
+ date: 2018-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rotp
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.5.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: sqlite3
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -143,25 +157,15 @@ executables: []
143
157
  extensions: []
144
158
  extra_rdoc_files: []
145
159
  files:
146
- - ".gitignore"
147
- - ".rspec"
148
- - ".travis.yml"
149
160
  - Appraisals
150
161
  - CODE_OF_CONDUCT.md
151
162
  - CONTRIBUTING.md
163
+ - Dockerfile
152
164
  - Gemfile
165
+ - Gemfile.lock
153
166
  - LICENSE
154
167
  - README.md
155
168
  - Rakefile
156
- - config/secrets.yml
157
- - gemfiles/rails3.0.gemfile
158
- - gemfiles/rails3.1.gemfile
159
- - gemfiles/rails3.2.gemfile
160
- - gemfiles/rails4.0.gemfile
161
- - gemfiles/rails4.1.gemfile
162
- - gemfiles/rails4.2.gemfile
163
- - gemfiles/rails5.0.gemfile
164
- - google-authenticator.gemspec
165
169
  - lib/google-authenticator-rails.rb
166
170
  - lib/google-authenticator-rails/action_controller.rb
167
171
  - lib/google-authenticator-rails/action_controller/rails_adapter.rb
@@ -173,7 +177,6 @@ files:
173
177
  - lib/google-authenticator-rails/session/base.rb
174
178
  - lib/google-authenticator-rails/session/persistence.rb
175
179
  - lib/google-authenticator-rails/version.rb
176
- - lib/tasks/google_authenticator.rake
177
180
  - spec/action_controller/integration_spec.rb
178
181
  - spec/action_controller/rails_adapter_spec.rb
179
182
  - spec/google_authenticator_spec.rb
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- .rvmrc
7
- .rspec
8
- .ruby-gemset
9
- .ruby-version
10
- Gemfile.lock
11
- gemfiles/*.lock
12
- InstalledFiles
13
- _yardoc
14
- coverage
15
- doc/
16
- lib/bundler/man
17
- pkg
18
- rdoc
19
- spec/reports
20
- test/tmp
21
- test/version_tmp
22
- tmp
23
- vendor
data/.travis.yml DELETED
@@ -1,16 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.0
6
- - 2.2.5
7
- - 2.3.1
8
- # - jruby-18mode # JRuby in 1.8 mode
9
- # - jruby-19mode # JRuby in 1.9 mode
10
- # - rbx-18mode
11
- # - rbx-19mode
12
- matrix:
13
- allow_failures:
14
- - rvm: 1.9.3
15
- - rvm: 2.0.0
16
- - rvm: 2.1.0
data/config/secrets.yml DELETED
@@ -1,3 +0,0 @@
1
- test:
2
- secret_key_base: ea13d27b89aaa5004212cc78552e2a1f0ceaa21f797de0089277506a036b1d450f8508eb51b838c04af477c6d03d7c8b0f3258937dc291935eb49c2a8f3fa9d9
3
- old_secret_key_base: c9e4baab86ab1d7373eafd7fbc467b227d44e23608834ea5bdfc502bd33211d205f245a06ced789af579e8d77aa4c1bfd605065190ee24d3709ada92366cadfb
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 3.0.0"
6
-
7
- gemspec :path=>"../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 3.1.0"
6
-
7
- gemspec :path=>"../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 3.2.0"
6
-
7
- gemspec :path=>"../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 4.0.0"
6
- gem "protected_attributes"
7
-
8
- gemspec :path=>"../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 4.1.0"
6
- gem "protected_attributes"
7
-
8
- gemspec :path=>"../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 4.2.0"
6
-
7
- gemspec :path=>"../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 5.0.0"
6
-
7
- gemspec :path=>"../"
@@ -1,34 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/google-authenticator-rails/version', __FILE__)
3
-
4
- version_info = RUBY_VERSION.split(".")
5
-
6
- major = version_info.first.to_i
7
- minor = version_info[1].to_i
8
- hotfix = version_info.last.to_i
9
-
10
- Gem::Specification.new do |gem|
11
- gem.authors = ["Jared McFarland"]
12
- gem.email = ["jared.online@gmail.com"]
13
- gem.description = %q{Add the ability to use the Google Authenticator with ActiveRecord.}
14
- gem.summary = %q{Add the ability to use the Google Authenticator with ActiveRecord.}
15
- gem.homepage = "http://github.com/jaredonline/google-authenticator"
16
-
17
- gem.files = `git ls-files`.split($\)
18
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
19
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
- gem.name = "google-authenticator-rails"
21
- gem.require_paths = ["lib"]
22
- gem.version = Google::Authenticator::Rails::VERSION
23
-
24
- gem.add_dependency "rotp", "= 1.6.1"
25
- gem.add_dependency "rails"
26
- gem.add_dependency "activerecord"
27
- gem.add_dependency "google-qr"
28
- gem.add_dependency "actionpack"
29
-
30
- gem.add_development_dependency "rake", "~> 11.0"
31
- gem.add_development_dependency "rspec", "~> 2.8.0"
32
- gem.add_development_dependency "appraisal", "~> 0.5.1"
33
- gem.add_development_dependency "sqlite3"
34
- end
@@ -1,55 +0,0 @@
1
- namespace :google_authenticator do
2
-
3
- def do_encrypt(args, already_encrypted, op_name)
4
- model_names = if args[:optional_model_list]
5
- args.extras.unshift(args[:optional_model_list])
6
- else
7
- # Adapted from https://stackoverflow.com/a/8248849/7478194
8
- Dir[Rails.root.join('app/models/*.rb').to_s].map { |filename| File.basename(filename, '.rb').camelize }
9
- end
10
-
11
- ActiveRecord::Base.transaction do
12
- match_op = " = #{already_encrypted ? 138 : 16}"
13
- model_names.each do |model_name|
14
- klass = model_name.constantize
15
- next unless klass.ancestors.include?(ActiveRecord::Base) && klass.try(:google_secrets_encrypted)
16
- print "#{op_name}ing model #{klass.name.inspect} (table #{klass.table_name.inspect}): "
17
- count = 0
18
- klass.where("LENGTH(#{klass.google_secret_column})#{match_op}").find_each do |record|
19
- yield record
20
- count += 1
21
- end
22
- puts "#{count} #{'secret'.pluralize(count)} #{op_name}ed"
23
- end
24
- end
25
- end
26
-
27
- desc 'Encrypt all secret columns (add the :encrypt_secrets options *before* running)'
28
- task :encrypt_secrets, [:optional_model_list] => :environment do |_t, args|
29
- do_encrypt(args, false, 'Encrypt') { |record| record.encrypt_google_secret! }
30
- end
31
-
32
- desc 'Re-encrypt all secret columns from old_secret_key_base to secret_key_base'
33
- task :reencrypt_secrets, [:optional_model_list] => :environment do |_t, args|
34
- if Rails.application.secrets.old_secret_key_base.blank?
35
- puts 'old_secret_key_base is not set in config/secrets.yml'
36
- else
37
- secret_encryptor = GoogleAuthenticatorRails::ActiveRecord::Helpers.get_google_secret_encryptor
38
- Rails.application.secrets[:secret_key_base] = Rails.application.secrets.old_secret_key_base
39
- Rails.application.instance_eval { @caching_key_generator = nil }
40
- old_secret_encryptor = GoogleAuthenticatorRails::ActiveRecord::Helpers.get_google_secret_encryptor
41
- do_encrypt(args, true, 'Re-encrypt') do |record|
42
- GoogleAuthenticatorRails.secret_encryptor = old_secret_encryptor
43
- plain_secret = record.google_secret_value
44
- GoogleAuthenticatorRails.secret_encryptor = secret_encryptor
45
- record.send(:change_google_secret_to!, plain_secret)
46
- end
47
- end
48
- end
49
-
50
- desc 'Decrypt all secret columns (remove the :encrypt_secrets options *after* running)'
51
- task :decrypt_secrets, [:optional_model_list] => :environment do |_t, args|
52
- do_encrypt(args, true, 'Decrypt') { |record| record.send(:change_google_secret_to!, record.google_secret_value, false) }
53
- end
54
-
55
- end