devise-authy 2.2.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9332df09a8a1b3e1a71ff775f2cccc75c573123eccb8a6830454cdc3ef3834d
4
- data.tar.gz: a0e4f00b59ece3eefe9fee9c04c51227216e13f241ac24afe94c4ec361416443
3
+ metadata.gz: 259b34a666d62e180d4ae64b3e2100c0bd21f9ee4c8b9346064551b3178cfb54
4
+ data.tar.gz: f83cb9da5873b5e811cba37b2150cbce44ce725d28244d8258f40f68983518ed
5
5
  SHA512:
6
- metadata.gz: 3d00cb1eb54d0169277b2e514431bb121f8c5e2dc6a565e07786a4866a29904b301a3730cdbff201f48d1ba5afb4c8b10249b75e9c8ab45da8a0022b9b1f64f9
7
- data.tar.gz: 54596845d7b20034aa433497281d74135886f59828e9ae8026ae9fc43f0cfe2b4874cd90c4d69f8295ff76bc02ac7eaadb077fd53d1281354f7a3aa113dac65e
6
+ metadata.gz: 869414ee49e8c36570335144e2bf02781811301c2c6fed0142dd27bbf028f5e08b8c16832afe515ed9703eee99f5e664b00b5598e1c6a26db0b63b3451e81b46
7
+ data.tar.gz: d066492cbf36871ec392a940f7927be61c7fee1c0b4a7db2b2279c608c2dcbbd3c054ea70d9543586542dc3f256b06eb9221431c1a812ad27c285fe17d1411ee
@@ -0,0 +1,32 @@
1
+ name: build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby: [2.5, 2.6, 2.7, "3.0", 3.1, head]
12
+ gemfile: [rails_5_2, rails_6]
13
+ exclude:
14
+ - ruby: "3.0"
15
+ gemfile: rails_5_2
16
+ - ruby: 3.1
17
+ gemfile: rails_5_2
18
+ - ruby: head
19
+ gemfile: rails_5_2
20
+ continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
21
+ env:
22
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
23
+ steps:
24
+ - uses: actions/checkout@v2
25
+ - name: Set up Ruby ${{ matrix.ruby }}
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby }}
29
+ - name: Install dependencies
30
+ run: bundle install
31
+ - name: Run tests
32
+ run: bundle exec rspec
data/Appraisals CHANGED
@@ -7,11 +7,12 @@ appraise "rails-5-2" do
7
7
  gem 'rspec-rails', "~>4.0.0.beta3", :require => false
8
8
  gem 'database_cleaner', :require => false
9
9
  end
10
- end
10
+ end if RUBY_VERSION.to_f < 3.0
11
11
 
12
12
  appraise "rails-6" do
13
13
  gem "rails", "~> 6.0.0"
14
14
  gem "sqlite3", "~> 1.4"
15
+ gem "net-smtp"
15
16
 
16
17
  group :development, :test do
17
18
  gem 'factory_girl_rails', :require => false
data/CHANGELOG.md CHANGED
@@ -5,9 +5,26 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [2.3.1] - 2022-05-30 Final release
9
9
 
10
- ...
10
+ ### Changed
11
+
12
+ - Added deprecation notices to README and Gemspec
13
+
14
+ ## [2.3.0] - 2021-01-07
15
+
16
+ ### Fixed
17
+
18
+ - Fixes calls to `I18n.t` with keyword arguments to support Ruby 3.0
19
+ - Replaces Travis CI with GitHub Actions
20
+ - Updates webmock development dependency
21
+ - Removes sdoc from Gemfile
22
+
23
+ ## [2.2.1] - 2020-10-13
24
+
25
+ ### Fixed
26
+
27
+ - If the app offers a QR code scan and user fails to verify authy installation, the QR code wasn't shown again. Fixed in (#149)
11
28
 
12
29
  ## [2.2.0] - 2020-06-04
13
30
 
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
4
-
5
- # bundle exec rake doc:rails generates the API under doc/api.
6
- gem 'sdoc', '~> 0.4.0', group: :doc
3
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2020 Authy Inc
1
+ Copyright (c) 2012-2021 Authy Inc
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.md CHANGED
@@ -1,4 +1,22 @@
1
- # Authy Devise [![Build Status](https://travis-ci.org/twilio/authy-devise.svg?branch=master)](https://travis-ci.org/twilio/authy-devise)
1
+ 🚨🚨🚨
2
+
3
+ **This library is no longer actively maintained.** The Authy API has been replaced with the [Twilio Verify API](https://www.twilio.com/docs/verify). Twilio will support the Authy API through November 1, 2022 for SMS/Voice. After this date, we’ll start to deprecate the service for SMS/Voice. Any requests sent to the API after May 1, 2023, will automatically receive an error. Push and TOTP will continue to be supported through July 2023.
4
+
5
+ [Learn more about migrating from Authy to Verify.](https://www.twilio.com/blog/migrate-authy-to-verify)
6
+
7
+ Please visit the Twilio Docs for:
8
+ * [Verify + Ruby (Rails) quickstart](https://www.twilio.com/docs/verify/quickstarts/ruby-rails)
9
+ * [Twilio Ruby helper library](https://www.twilio.com/docs/libraries/ruby)
10
+ * [Verify API reference](https://www.twilio.com/docs/verify/api)
11
+ * **Coming soon**: Look out for a new Devise plugin to use Twilio Verify with Devise
12
+
13
+ Please direct any questions to [Twilio Support](https://support.twilio.com/hc/en-us). Thank you!
14
+
15
+ 🚨🚨🚨
16
+
17
+ ---
18
+
19
+ # Authy Devise [![Build Status](https://github.com/twilio/authy-devise/workflows/build/badge.svg)](https://github.com/twilio/authy-devise/actions)
2
20
 
3
21
  This is a [Devise](https://github.com/plataformatec/devise) extension to add [Two-Factor Authentication with Authy](https://www.twilio.com/docs/authy) to your Rails application.
4
22
 
@@ -18,6 +36,7 @@ This is a [Devise](https://github.com/plataformatec/devise) extension to add [Tw
18
36
  * [Generic authenticator token support](#generic-authenticator-token-support)
19
37
  * [Rails 5 CSRF protection](#rails-5-csrf-protection)
20
38
  * [Running Tests](#running-tests)
39
+ * [Notice: Twilio Authy API’s Sandbox feature will stop working on Sep 30, 2021](#notice-twilio-authy-apis-sandbox-feature-will-stop-working-on-sep-30-2021)
21
40
  * [Copyright](#copyright)
22
41
 
23
42
  ## Pre-requisites
@@ -60,20 +79,24 @@ You can add devise_authy to your user model in two ways.
60
79
 
61
80
  #### With the generator
62
81
 
63
- This is the easiest way and is recommended. Run the following command:
82
+ Run the following command:
64
83
 
65
84
  ```bash
66
85
  rails g devise_authy [MODEL_NAME]
67
86
  ```
68
87
 
88
+ To support account locking (recommended), you must add `:authy_lockable` to the `devise :authy_authenticatable, ...` configuration in your model as this is not yet supported by the generator.
89
+
69
90
  #### Manually
70
91
 
71
- Add `:authy_authenticatable` to the `devise` options in your Devise user model:
92
+ Add `:authy_authenticatable` and `:authy_lockable` to the `devise` options in your Devise user model:
72
93
 
73
94
  ```ruby
74
- devise :authy_authenticatable, :database_authenticatable
95
+ devise :authy_authenticatable, :authy_lockable, :database_authenticatable, :lockable
75
96
  ```
76
97
 
98
+ (Note, `:authy_lockable` is optional but recommended. It should be used with Devise's own `:lockable` module).
99
+
77
100
  Also add a new migration. For example, if you are adding to the `User` model, use this migration:
78
101
 
79
102
  ```ruby
@@ -223,20 +246,21 @@ end
223
246
 
224
247
  ## Running Tests
225
248
 
226
- To prepare the tests run the following commands:
249
+ Run the following command:
227
250
 
228
251
  ```bash
229
- $ cd spec/rails-app
230
- $ bundle install
231
- $ RAILS_ENV=test bundle exec rake db:migrate
252
+ $ bundle exec rspec
232
253
  ```
233
254
 
234
- Now on the project root run the following commands:
255
+ ## Notice: Twilio Authy API’s Sandbox feature will stop working on Sep 30, 2021
256
+ Twilio is discontinuing the Authy API’s Sandbox, a feature that allows customers to run continuous integration tests against a mock Authy API for free. The Sandbox is no longer being maintained, so we will be taking the final deprecation step of shutting it down on September 30, 2021. The rest of the Authy API product will continue working as-is.
235
257
 
236
- ```bash
237
- $ bundle exec rspec spec/
238
- ```
258
+ This repo previously used the sandbox API as part of the test suite, but that has been since removed.
259
+
260
+ You will only be affected if you are using the sandbox API in your own application or test suite.
261
+
262
+ For more information please read this article on [how we are discontinuing the Twilio Authy sandbox API](https://support.authy.com/hc/en-us/articles/1260803396889-Notice-Twilio-Authy-API-s-Sandbox-feature-will-stop-working-on-Sep-30-2021).
239
263
 
240
264
  ## Copyright
241
265
 
242
- Copyright (c) 2012-2020 Authy Inc. See LICENSE.txt for further details.
266
+ Copyright (c) 2012-2021 Authy Inc. See LICENSE.txt for further details.
@@ -131,6 +131,10 @@ class Devise::DeviseAuthyController < DeviseController
131
131
  set_flash_message(:notice, :enabled)
132
132
  redirect_to after_authy_verified_path_for(resource)
133
133
  else
134
+ if resource_class.authy_enable_qr_code
135
+ response = Authy::API.request_qr_code(id: resource.authy_id)
136
+ @authy_qr_code = response.qr_code
137
+ end
134
138
  handle_invalid_token :verify_authy_installation, :not_enabled
135
139
  end
136
140
  end
@@ -1,7 +1,7 @@
1
- <h2><%= I18n.t('authy_register_title', {:scope => 'devise'}) %></h2>
1
+ <h2><%= I18n.t('authy_register_title', scope: 'devise') %></h2>
2
2
 
3
3
  <%= enable_authy_form do %>
4
4
  <%= text_field_tag :country_code, '', :autocomplete => :off, :placeholder => I18n.t('devise.country'), :id => "authy-countries"%>
5
5
  <%= text_field_tag :cellphone, '', :autocomplete => :off, :placeholder => I18n.t('devise.cellphone'), :id => "authy-cellphone"%>
6
- <p><%= submit_tag I18n.t('enable_authy', {:scope => 'devise'}) %></p>
6
+ <p><%= submit_tag I18n.t('enable_authy', scope: 'devise') %></p>
7
7
  <% end %>
@@ -1,5 +1,5 @@
1
- %h2= I18n.t('authy_register_title', {:scope => 'devise'})
1
+ %h2= I18n.t('authy_register_title', scope: 'devise')
2
2
  = enable_authy_form do
3
3
  = text_field_tag :country_code, '', :autocomplete => :off, :placeholder => I18n.t('devise.country'), :id => "authy-countries"
4
4
  = text_field_tag :cellphone, '', :autocomplete => :off, :placeholder => I18n.t('devise.cellphone'), :id => "authy-cellphone"
5
- %p= submit_tag I18n.t('enable_authy', {:scope => 'devise'})
5
+ %p= submit_tag I18n.t('enable_authy', scope: 'devise')
@@ -1,14 +1,14 @@
1
1
  <h2>
2
- <%= I18n.t('submit_token_title', {:scope => 'devise'}) %>
2
+ <%= I18n.t('submit_token_title', scope: 'devise') %>
3
3
  </h2>
4
4
 
5
5
  <%= verify_authy_form do %>
6
- <legend><%= I18n.t('submit_token_title', {:scope => 'devise'}) %></legend>
6
+ <legend><%= I18n.t('submit_token_title', scope: 'devise') %></legend>
7
7
  <%= label_tag 'authy-token' %>
8
8
  <%= text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token' %>
9
9
  <label>
10
10
  <%= check_box_tag :remember_device %>
11
- <span><%= I18n.t('remember_device', {:scope => 'devise'}) %></span>
11
+ <span><%= I18n.t('remember_device', scope: 'devise') %></span>
12
12
  </label>
13
13
 
14
14
  <!-- Help tooltip -->
@@ -17,7 +17,7 @@
17
17
  <!-- <%= link_to '?', '#', :id => 'authy-help' %> -->
18
18
 
19
19
  <%= authy_request_sms_link %>
20
- <%= submit_tag I18n.t('submit_token', {:scope => 'devise'}), :class => 'btn' %>
20
+ <%= submit_tag I18n.t('submit_token', scope: 'devise'), :class => 'btn' %>
21
21
  <% end %>
22
22
 
23
23
  <% if @onetouch_uuid %>
@@ -1,13 +1,13 @@
1
- %h2= I18n.t('authy_register_title', {:scope => 'devise'})
1
+ %h2= I18n.t('authy_register_title', scope: 'devise')
2
2
 
3
3
  = verify_authy_form do
4
- %legend= I18n.t('submit_token_title', {:scope => 'devise'})
4
+ %legend= I18n.t('submit_token_title', scope: 'devise')
5
5
  = hidden_field_tag :"#{resource_name}_id", @resource.id
6
6
  = label_tag 'authy-token'
7
7
  = text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token'
8
8
  %label
9
9
  = check_box_tag :remember_device
10
- %span= I18n.t('remember_device', {:scope => 'devise'})
10
+ %span= I18n.t('remember_device', scope: 'devise')
11
11
 
12
12
  / Help Tooltip
13
13
  / You need to configure a help message.
@@ -15,7 +15,7 @@
15
15
  / = link_to '?', '#', :id => 'authy-help', :'data-message' => 'a message'
16
16
 
17
17
  = authy_request_sms_link
18
- = submit_tag I18n.t('submit_token', {:scope => 'devise'}), :class => 'btn'
18
+ = submit_tag I18n.t('submit_token', scope: 'devise'), :class => 'btn'
19
19
 
20
20
  - if @onetouch_uuid
21
21
  :javascript
@@ -1,18 +1,18 @@
1
- <h2><%= I18n.t('authy_verify_installation_title', {:scope => 'devise'}) %></h2>
1
+ <h2><%= I18n.t('authy_verify_installation_title', scope: 'devise') %></h2>
2
2
 
3
3
  <% if @authy_qr_code %>
4
- <%= image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', {:scope => 'devise'}) %>
5
- <p><%= I18n.t('authy_qr_code_instructions', {:scope => 'devise'}) %></p>
4
+ <%= image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', scope: 'devise') %>
5
+ <p><%= I18n.t('authy_qr_code_instructions', scope: 'devise') %></p>
6
6
  <% end %>
7
7
 
8
8
  <%= verify_authy_installation_form do %>
9
- <legend><%= I18n.t('submit_token_title', {:scope => 'devise'}) %></legend>
9
+ <legend><%= I18n.t('submit_token_title', scope: 'devise') %></legend>
10
10
  <%= label_tag :token %>
11
11
  <%= text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token' %>
12
12
  <label>
13
13
  <%= check_box_tag :remember_device %>
14
- <span><%= I18n.t('remember_device', {:scope => 'devise'}) %></span>
14
+ <span><%= I18n.t('remember_device', scope: 'devise') %></span>
15
15
  </label>
16
16
  <%= authy_request_sms_link %>
17
- <%= submit_tag I18n.t('enable_my_account', {:scope => 'devise'}), :class => 'btn' %>
17
+ <%= submit_tag I18n.t('enable_my_account', scope: 'devise'), :class => 'btn' %>
18
18
  <% end %>
@@ -1,16 +1,16 @@
1
- %h2= I18n.t('authy_verify_installation_title', {:scope => 'devise'})
1
+ %h2= I18n.t('authy_verify_installation_title', scope: 'devise')
2
2
 
3
3
  - if @authy_qr_code
4
- = image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', {:scope => 'devise'})
5
- %p= I18n.t('authy_qr_code_instructions', {:scope => 'devise'})
4
+ = image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', scope: 'devise')
5
+ %p= I18n.t('authy_qr_code_instructions', scope: 'devise')
6
6
 
7
7
  = verify_authy_installation_form do
8
- %legend= I18n.t('submit_token_title', {:scope => 'devise'})
8
+ %legend= I18n.t('submit_token_title', scope: 'devise')
9
9
  = label_tag :token
10
10
  = text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token'
11
11
  %label
12
12
  = check_box_tag :remember_device
13
- %span= I18n.t('remember_device', {:scope => 'devise'})
13
+ %span= I18n.t('remember_device', scope: 'devise')
14
14
  = authy_request_sms_link
15
- = submit_tag I18n.t('enable_my_account', {:scope => 'devise'}), :class => 'btn'
15
+ = submit_tag I18n.t('enable_my_account', scope: 'devise'), :class => 'btn'
16
16
 
data/devise-authy.gemspec CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ["Authy Inc."]
11
11
  spec.email = ["support@authy.com"]
12
12
 
13
- spec.summary = %q{Authy plugin for Devise.}
14
- spec.description = %q{Authy plugin to add two factor authentication to Devise.}
13
+ spec.summary = %q{Deprecated: please see README for details}
14
+ spec.description = %q{Authy plugin to add two factor authentication to Devise. This gem is deprecated, please see the README for details.}
15
15
  spec.homepage = "https://github.com/twilio/authy-devise"
16
16
  spec.license = "MIT"
17
17
 
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_dependency "devise", ">= 4.0.0"
32
- spec.add_dependency "authy", ">= 2.7.5"
32
+ spec.add_dependency "authy", "~> 3.0"
33
33
 
34
34
  spec.add_development_dependency "appraisal", "~> 2.2"
35
35
  spec.add_development_dependency "bundler", ">= 1.16"
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "yard", "~> 0.9.11"
42
42
  spec.add_development_dependency "rdoc", "~> 4.3.0"
43
43
  spec.add_development_dependency "simplecov", "~> 0.17.1"
44
- spec.add_development_dependency "webmock", "~> 3.7.6"
44
+ spec.add_development_dependency "webmock", "~> 3.11.0"
45
45
  spec.add_development_dependency "rails", ">= 5"
46
46
  spec.add_development_dependency "sqlite3"
47
47
  spec.add_development_dependency "generator_spec"
@@ -2,7 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sdoc", "~> 0.4.0", group: :doc
6
5
  gem "rails", "~> 5.2.0"
7
6
  gem "sqlite3", "~> 1.3.13"
8
7
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sdoc", "~> 0.4.0", group: :doc
6
5
  gem "rails", "~> 6.0.0"
7
6
  gem "sqlite3", "~> 1.4"
7
+ gem "net-smtp"
8
8
 
9
9
  group :development, :test do
10
10
  gem "factory_girl_rails", require: false
@@ -77,7 +77,7 @@ module DeviseAuthy
77
77
  end
78
78
 
79
79
  def send_one_touch_request(authy_id)
80
- Authy::OneTouch.send_approval_request(id: authy_id, message: I18n.t('request_to_login', { :scope => 'devise' }))
80
+ Authy::OneTouch.send_approval_request(id: authy_id, message: I18n.t('request_to_login', scope: 'devise'))
81
81
  end
82
82
 
83
83
  def record_authy_authentication
@@ -3,7 +3,7 @@ module DeviseAuthy
3
3
  module Helpers
4
4
  def authy_request_phone_call_link(opts = {})
5
5
  title = opts.delete(:title) do
6
- I18n.t('request_phone_call', { :scope => 'devise' })
6
+ I18n.t('request_phone_call', scope: 'devise')
7
7
  end
8
8
  opts = {
9
9
  :id => "authy-request-phone-call-link",
@@ -13,7 +13,7 @@ module DeviseAuthy
13
13
 
14
14
  link_to(
15
15
  title,
16
- url_for([resource_name, :request_phone_call]),
16
+ url_for([resource_name.to_sym, :request_phone_call]),
17
17
  opts
18
18
  )
19
19
  end
@@ -30,14 +30,14 @@ module DeviseAuthy
30
30
 
31
31
  link_to(
32
32
  title,
33
- url_for([resource_name, :request_sms]),
33
+ url_for([resource_name.to_sym, :request_sms]),
34
34
  opts
35
35
  )
36
36
  end
37
37
 
38
38
  def verify_authy_form(opts = {}, &block)
39
39
  opts = default_opts.merge(:id => 'devise_authy').merge(opts)
40
- form_tag([resource_name, :verify_authy], opts) do
40
+ form_tag([resource_name.to_sym, :verify_authy], opts) do
41
41
  buffer = hidden_field_tag(:"#{resource_name}_id", @resource.id)
42
42
  buffer << capture(&block)
43
43
  end
@@ -45,14 +45,14 @@ module DeviseAuthy
45
45
 
46
46
  def enable_authy_form(opts = {}, &block)
47
47
  opts = default_opts.merge(opts)
48
- form_tag([resource_name, :enable_authy], opts) do
48
+ form_tag([resource_name.to_sym, :enable_authy], opts) do
49
49
  capture(&block)
50
50
  end
51
51
  end
52
52
 
53
53
  def verify_authy_installation_form(opts = {}, &block)
54
54
  opts = default_opts.merge(opts)
55
- form_tag([resource_name, :verify_authy_installation], opts) do
55
+ form_tag([resource_name.to_sym, :verify_authy_installation], opts) do
56
56
  capture(&block)
57
57
  end
58
58
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeviseAuthy
4
- VERSION = '2.2.0'
5
- end
4
+ VERSION = '2.3.1'
5
+ end
data/lib/devise-authy.rb CHANGED
@@ -33,3 +33,5 @@ Authy.user_agent = "DeviseAuthy/#{DeviseAuthy::VERSION} - #{Authy.user_agent}"
33
33
 
34
34
  Devise.add_module :authy_authenticatable, :model => 'devise-authy/models/authy_authenticatable', :controller => :devise_authy, :route => :authy
35
35
  Devise.add_module :authy_lockable, :model => 'devise-authy/models/authy_lockable'
36
+
37
+ warn "DEPRECATION WARNING: The authy-devise library is no longer actively maintained. The Authy API is being replaced by the Twilio Verify API. Please see the README for more details."
@@ -3,22 +3,21 @@
3
3
  module DeviseAuthy
4
4
  module Generators
5
5
  class DeviseAuthyGenerator < Rails::Generators::NamedBase
6
-
7
6
  namespace "devise_authy"
8
7
 
9
8
  desc "Add :authy_authenticatable directive in the given model, plus accessors. Also generate migration for ActiveRecord"
10
9
 
11
10
  def inject_devise_authy_content
12
- path = File.join(destination_root, "app","models","#{file_path}.rb")
13
- if File.exists?(path) &&
14
- !File.read(path).include?("authy_authenticatable")
11
+ path = File.join(destination_root, "app", "models", "#{file_path}.rb")
12
+ if File.exist?(path) &&
13
+ !File.read(path).include?("authy_authenticatable")
15
14
  inject_into_file(path,
16
15
  "authy_authenticatable, :",
17
16
  :after => "devise :")
18
17
  end
19
18
 
20
- if File.exists?(path) &&
21
- !File.read(path).include?(":authy_id")
19
+ if File.exist?(path) &&
20
+ !File.read(path).include?(":authy_id")
22
21
  inject_into_file(path,
23
22
  ":authy_id, :last_sign_in_with_authy, ",
24
23
  :after => "attr_accessible ")
@@ -26,7 +25,6 @@ module DeviseAuthy
26
25
  end
27
26
 
28
27
  hook_for :orm
29
-
30
28
  end
31
29
  end
32
30
  end
@@ -73,7 +73,7 @@ module DeviseAuthy
73
73
  }
74
74
  }.each do |extension, opts|
75
75
  file_path = File.join(destination_root, "app", "views", "layouts", "application.html.#{extension}")
76
- if File.exists?(file_path) && !File.read(file_path).include?("form.authy.min.js")
76
+ if File.exist?(file_path) && !File.read(file_path).include?("form.authy.min.js")
77
77
  inject_into_file(file_path, opts.delete(:content), opts)
78
78
  end
79
79
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-authy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Authy Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-04 00:00:00.000000000 Z
11
+ date: 2022-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: authy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.7.5
33
+ version: '3.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.7.5
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 3.7.6
187
+ version: 3.11.0
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 3.7.6
194
+ version: 3.11.0
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rails
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -262,7 +262,8 @@ dependencies:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
264
  version: 5.1.1
265
- description: Authy plugin to add two factor authentication to Devise.
265
+ description: Authy plugin to add two factor authentication to Devise. This gem is
266
+ deprecated, please see the README for details.
266
267
  email:
267
268
  - support@authy.com
268
269
  executables: []
@@ -270,9 +271,9 @@ extensions: []
270
271
  extra_rdoc_files: []
271
272
  files:
272
273
  - ".document"
274
+ - ".github/workflows/build.yml"
273
275
  - ".gitignore"
274
276
  - ".rspec"
275
- - ".travis.yml"
276
277
  - Appraisals
277
278
  - CHANGELOG.md
278
279
  - Gemfile
@@ -319,7 +320,7 @@ metadata:
319
320
  documentation_uri: https://github.com/twilio/authy-devise
320
321
  homepage_uri: https://github.com/twilio/authy-devise
321
322
  source_code_uri: https://github.com/twilio/authy-devise
322
- post_install_message:
323
+ post_install_message:
323
324
  rdoc_options: []
324
325
  require_paths:
325
326
  - lib
@@ -334,8 +335,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
335
  - !ruby/object:Gem::Version
335
336
  version: '0'
336
337
  requirements: []
337
- rubygems_version: 3.0.1
338
- signing_key:
338
+ rubygems_version: 3.2.32
339
+ signing_key:
339
340
  specification_version: 4
340
- summary: Authy plugin for Devise.
341
+ summary: 'Deprecated: please see README for details'
341
342
  test_files: []
data/.travis.yml DELETED
@@ -1,17 +0,0 @@
1
- language: ruby
2
- script: bundle exec rspec
3
- rvm:
4
- - 2.7
5
- - 2.6
6
- - 2.5
7
- - 2.4
8
- - ruby-head
9
- gemfile:
10
- - gemfiles/rails_5_2.gemfile
11
- - gemfiles/rails_6.gemfile
12
- matrix:
13
- allow_failures:
14
- - rvm: ruby-head
15
- exclude:
16
- - rvm: 2.4
17
- gemfile: gemfiles/rails_6.gemfile