devise_gauth 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/{devise_google_authenticatable → devise_gauth}/controllers/helpers.rb +1 -1
  4. data/lib/{devise_google_authenticatable → devise_gauth}/models/google_authenticatable.rb +1 -1
  5. data/lib/{devise_google_authenticatable → devise_gauth}/orm/active_record.rb +4 -5
  6. data/lib/{devise_google_authenticatable → devise_gauth}/patches/display_qr.rb +1 -1
  7. data/lib/{devise_google_authenticatable → devise_gauth}/patches.rb +2 -2
  8. data/lib/{devise_google_authenticatable → devise_gauth}/rails.rb +5 -5
  9. data/lib/{devise_google_authenticatable → devise_gauth}/schema.rb +1 -1
  10. data/lib/devise_gauth/version.rb +5 -0
  11. data/lib/{devise_google_authenticatable → devise_gauth}/views/helpers.rb +1 -1
  12. data/lib/{devise_google_authenticator.rb → devise_gauth.rb} +12 -11
  13. data/lib/generators/active_record/devise_google_authenticator_generator.rb +3 -3
  14. data/lib/generators/active_record/templates/migration.rb +1 -1
  15. data/lib/generators/{devise_google_authenticator/devise_google_authenticator_generator.rb → devise_gauth/devise_gauth_generator.rb} +4 -4
  16. data/lib/generators/{devise_google_authenticator → devise_gauth}/install_generator.rb +3 -3
  17. data/lib/generators/{devise_google_authenticator → devise_gauth}/views_generator.rb +1 -1
  18. data/lib/generators/mongoid/devise_google_authenticator_generator.rb +1 -1
  19. metadata +17 -17
  20. data/lib/devise_google_authenticatable/version.rb +0 -5
  21. /data/lib/{devise_google_authenticatable → devise_gauth}/hooks/totp_authenticatable.rb +0 -0
  22. /data/lib/{devise_google_authenticatable → devise_gauth}/routes.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b039c2c2ee6fad1f90a59233c3efcfee4c45abf2283404e0c4dd3d591dd59210
4
- data.tar.gz: caf22602fe4fb7e58c7726dbc3632c45351ab770dbea9bdbb0347a3e2f2a7291
3
+ metadata.gz: f5d375b4b4cc691c0ac00cebf17c6d59e305afe69e0ccaa63ce7e820ea4706f3
4
+ data.tar.gz: 937241dfb4a7628db0a48764b2bb609c076bcb4ee0143da719cc700402f75699
5
5
  SHA512:
6
- metadata.gz: 95d1af8ee25c393fab5e170ae3507bf68ea8809b372c140e6116dea0bcc591f025a3c8981ca1e3edf8bc5a60dbd1a5a29fc830e8aeeeb259c887d8375e4d8995
7
- data.tar.gz: a437d6f261dc15be7adf9278e722705f32073614c684119e45300f237b3c6d5e28503a12b6c131e4f5982b1c71688599cfbc2fb5f51dcbcf56bad85fe59fdcc9
6
+ metadata.gz: 3bf5018944357811dd3797f13bfdfbb52855dc77cfb3ba588534cc9019b379a439cb7c5091a930d392b4408d332810dbfcffeb6550b4fa7fcc43312ed20b5a5e
7
+ data.tar.gz: aa11d56d82f401badf4ca0d66fb00b101868e3fd7c8866b0817fbc17b726e2f1fb51e10c50d55e639a58976c194b5d5dd94e7687b40d55028a0c17e80318d5ad
data/README.md CHANGED
@@ -12,7 +12,7 @@ For more details see the `.github/workflows/ci.yml` file.
12
12
  Add the gem to your Gemfile (don't forget devise too):
13
13
 
14
14
  ```ruby
15
- gem 'devise_gauth', '0.4.2'
15
+ gem 'devise_gauth', '0.4.3'
16
16
  ```
17
17
 
18
18
  Don't forget to "bundle install"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseGoogleAuthenticator
3
+ module DeviseGauth
4
4
  module Controllers
5
5
  module Helpers
6
6
  extend ActiveSupport::Concern
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rotp'
4
- require 'devise_google_authenticatable/hooks/totp_authenticatable'
4
+ require 'devise_gauth/hooks/totp_authenticatable'
5
5
 
6
6
  module Devise
7
7
  module Models
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseGoogleAuthenticator
3
+ module DeviseGauth
4
4
  module Orm
5
5
  # This module contains handle schema (migrations):
6
6
  #
@@ -12,12 +12,11 @@ module DeviseGoogleAuthenticator
12
12
 
13
13
  module ActiveRecord
14
14
  module Schema
15
- include DeviseGoogleAuthenticator::Schema
15
+ include DeviseGauth::Schema
16
16
  end
17
17
  end
18
-
19
18
  end
20
19
  end
21
20
 
22
- ActiveRecord::ConnectionAdapters::Table.send :include, DeviseGoogleAuthenticator::Orm::ActiveRecord::Schema
23
- ActiveRecord::ConnectionAdapters::TableDefinition.send :include, DeviseGoogleAuthenticator::Orm::ActiveRecord::Schema
21
+ ActiveRecord::ConnectionAdapters::Table.send :include, DeviseGauth::Orm::ActiveRecord::Schema
22
+ ActiveRecord::ConnectionAdapters::TableDefinition.send :include, DeviseGauth::Orm::ActiveRecord::Schema
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseGoogleAuthenticator::Patches
3
+ module DeviseGauth::Patches
4
4
  # patch Registrations controller to display the QR code
5
5
  module DisplayQR
6
6
  extend ActiveSupport::Concern
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseGoogleAuthenticator
3
+ module DeviseGauth
4
4
  module Patches
5
- autoload :DisplayQR, 'devise_google_authenticatable/patches/display_qr'
5
+ autoload :DisplayQR, 'devise_gauth/patches/display_qr'
6
6
 
7
7
  class << self
8
8
  def apply
@@ -1,21 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'devise_google_authenticatable/controllers/helpers'
3
+ require 'devise_gauth/controllers/helpers'
4
4
 
5
- module DeviseGoogleAuthenticator
5
+ module DeviseGauth
6
6
  class Engine < ::Rails::Engine
7
7
  if Rails.version > '5'
8
8
  ActiveSupport::Reloader.to_prepare do
9
- DeviseGoogleAuthenticator::Patches.apply
9
+ DeviseGauth::Patches.apply
10
10
  end
11
11
  else
12
12
  ActionDispatch::Callbacks.to_prepare do
13
- DeviseGoogleAuthenticator::Patches.apply
13
+ DeviseGauth::Patches.apply
14
14
  end
15
15
  end
16
16
 
17
17
  ActiveSupport.on_load(:action_controller) do
18
- include DeviseGoogleAuthenticator::Controllers::Helpers
18
+ include DeviseGauth::Controllers::Helpers
19
19
  end
20
20
  end
21
21
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseGoogleAuthenticator
3
+ module DeviseGauth
4
4
  # add schema helper for migrations
5
5
  module Schema
6
6
  # Add gauth_secret columns in the resource's database tables
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DeviseGauth
4
+ VERSION = '0.4.3'
5
+ end
@@ -3,7 +3,7 @@
3
3
  require 'rqrcode'
4
4
  require 'base64'
5
5
 
6
- module DeviseGoogleAuthenticator
6
+ module DeviseGauth
7
7
  module Views
8
8
  module Helpers
9
9
  def build_qrcode_data_from(username, app, gauth_secret, qualifier = nil, issuer = nil)
@@ -28,17 +28,18 @@ module Devise # :nodoc:
28
28
  @@ga_bypass_signup = false
29
29
  end
30
30
 
31
- # a security extension for devise
32
- module DeviseGoogleAuthenticator
33
- autoload :Schema, 'devise_google_authenticatable/schema'
34
- autoload :Patches, 'devise_google_authenticatable/patches'
31
+ module DeviseGauth
32
+ autoload :Schema, 'devise_gauth/schema'
33
+ autoload :Patches, 'devise_gauth/patches'
35
34
  end
36
35
 
37
- require 'devise_google_authenticatable/routes'
38
- require 'devise_google_authenticatable/rails'
39
- require 'devise_google_authenticatable/orm/active_record'
40
- require 'devise_google_authenticatable/controllers/helpers'
41
- require 'devise_google_authenticatable/views/helpers'
42
- ActionView::Base.send :include, DeviseGoogleAuthenticator::Views::Helpers
36
+ require 'devise_gauth/routes'
37
+ require 'devise_gauth/rails'
38
+ require 'devise_gauth/orm/active_record'
39
+ require 'devise_gauth/controllers/helpers'
40
+ require 'devise_gauth/views/helpers'
41
+ ActionView::Base.send :include, DeviseGauth::Views::Helpers
43
42
 
44
- Devise.add_module :google_authenticatable, controller: :google_authenticatable, model: 'devise_google_authenticatable/models/google_authenticatable', route: :displayqr
43
+ Devise.add_module :google_authenticatable, controller: :google_authenticatable,
44
+ model: 'devise_gauth/models/google_authenticatable',
45
+ route: :displayqr
@@ -4,11 +4,11 @@ require 'rails/generators/active_record'
4
4
 
5
5
  module ActiveRecord
6
6
  module Generators
7
- class DeviseGoogleAuthenticatorGenerator < ActiveRecord::Generators::Base
8
- source_root File.expand_path("../templates", __FILE__)
7
+ class DeviseGauthGenerator < ActiveRecord::Generators::Base
8
+ source_root File.expand_path('templates', __dir__)
9
9
 
10
10
  def copy_devise_migration
11
- migration_template "migration.rb", "db/migrate/devise_google_authenticator_add_to_#{table_name}.rb"
11
+ migration_template 'migration.rb', "db/migrate/devise_gauth_add_to_#{table_name}.rb"
12
12
  end
13
13
  end
14
14
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class DeviseGoogleAuthenticatorAddTo<%= table_name.camelize %> < ActiveRecord::Migration
3
+ class DeviseGauthAddTo<%= table_name.camelize %> < ActiveRecord::Migration
4
4
  def self.up
5
5
  change_table :<%= table_name %> do |t|
6
6
  t.string :gauth_secret
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseGoogleAuthenticator
3
+ module DeviseGauth
4
4
  module Generators
5
- class DeviseGoogleAuthenticatorGenerator < Rails::Generators::NamedBase
6
- namespace 'devise_google_authenticator'
5
+ class DeviseGauthGenerator < Rails::Generators::NamedBase
6
+ namespace 'devise_gauth'
7
7
 
8
8
  desc 'Add :google_authenticatable directive in the given model, plus accessors. Also generate migration for ActiveRecord'
9
9
 
10
- def inject_devise_google_authenticator_content
10
+ def inject_devise_gauth_content
11
11
  path = File.join('app', 'models', "#{file_path}.rb")
12
12
 
13
13
  return unless File.exist?(path)
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseGoogleAuthenticator
3
+ module DeviseGauth
4
4
  module Generators
5
5
  # Install Generator
6
6
  class InstallGenerator < Rails::Generators::Base
7
- source_root File.expand_path('../../templates', __FILE__)
7
+ source_root File.expand_path('../templates', __dir__)
8
8
 
9
9
  desc 'Install the devise google authenticator extension'
10
10
 
@@ -27,7 +27,7 @@ module DeviseGoogleAuthenticator
27
27
  end
28
28
 
29
29
  def copy_locale
30
- copy_file '../../../config/locales/en.yml', 'config/locales/devise.google_authenticator.en.yml'
30
+ copy_file '../../../config/locales/en.yml', 'config/locales/devise.gauth.en.yml'
31
31
  end
32
32
  end
33
33
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'generators/devise/views_generator'
4
4
 
5
- module DeviseGoogleAuthenticator
5
+ module DeviseGauth
6
6
  module Generators
7
7
  class ViewsGenerator < Rails::Generators::Base
8
8
  desc 'Copies all Devise Google Authenticator views to your application.'
@@ -5,7 +5,7 @@ require 'generators/devise/orm_helpers'
5
5
 
6
6
  module Mongoid
7
7
  module Generators
8
- class DeviseGoogleAuthenticatorGenerator < Rails::Generators::NamedBase
8
+ class DeviseGauthGenerator < Rails::Generators::NamedBase
9
9
  include Devise::Generators::OrmHelpers
10
10
 
11
11
  def inject_field_types
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_gauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pharmony SA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-16 00:00:00.000000000 Z
11
+ date: 2024-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -107,23 +107,23 @@ files:
107
107
  - app/views/devise/checkga/show.html.erb
108
108
  - app/views/devise/displayqr/show.html.erb
109
109
  - config/locales/en.yml
110
- - lib/devise_google_authenticatable/controllers/helpers.rb
111
- - lib/devise_google_authenticatable/hooks/totp_authenticatable.rb
112
- - lib/devise_google_authenticatable/models/google_authenticatable.rb
113
- - lib/devise_google_authenticatable/orm/active_record.rb
114
- - lib/devise_google_authenticatable/patches.rb
115
- - lib/devise_google_authenticatable/patches/display_qr.rb
116
- - lib/devise_google_authenticatable/rails.rb
117
- - lib/devise_google_authenticatable/routes.rb
118
- - lib/devise_google_authenticatable/schema.rb
119
- - lib/devise_google_authenticatable/version.rb
120
- - lib/devise_google_authenticatable/views/helpers.rb
121
- - lib/devise_google_authenticator.rb
110
+ - lib/devise_gauth.rb
111
+ - lib/devise_gauth/controllers/helpers.rb
112
+ - lib/devise_gauth/hooks/totp_authenticatable.rb
113
+ - lib/devise_gauth/models/google_authenticatable.rb
114
+ - lib/devise_gauth/orm/active_record.rb
115
+ - lib/devise_gauth/patches.rb
116
+ - lib/devise_gauth/patches/display_qr.rb
117
+ - lib/devise_gauth/rails.rb
118
+ - lib/devise_gauth/routes.rb
119
+ - lib/devise_gauth/schema.rb
120
+ - lib/devise_gauth/version.rb
121
+ - lib/devise_gauth/views/helpers.rb
122
122
  - lib/generators/active_record/devise_google_authenticator_generator.rb
123
123
  - lib/generators/active_record/templates/migration.rb
124
- - lib/generators/devise_google_authenticator/devise_google_authenticator_generator.rb
125
- - lib/generators/devise_google_authenticator/install_generator.rb
126
- - lib/generators/devise_google_authenticator/views_generator.rb
124
+ - lib/generators/devise_gauth/devise_gauth_generator.rb
125
+ - lib/generators/devise_gauth/install_generator.rb
126
+ - lib/generators/devise_gauth/views_generator.rb
127
127
  - lib/generators/mongoid/devise_google_authenticator_generator.rb
128
128
  homepage: http://github.com/pharmony/devise_gauth
129
129
  licenses:
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DeviseGoogleAuthenticator
4
- VERSION = '0.4.2'
5
- end