devise-twilio-verify 0.2.0 → 0.2.1
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 +4 -4
- data/.gitignore +1 -0
- data/Appraisals +31 -7
- data/CHANGELOG.md +8 -0
- data/README.md +46 -46
- data/gemfiles/rails_5_2.gemfile +1 -1
- data/gemfiles/rails_6.gemfile +1 -1
- data/gemfiles/rails_7.gemfile +15 -0
- data/gemfiles/rails_7_1.gemfile +15 -0
- data/lib/devise-twilio-verify/version.rb +1 -1
- metadata +4 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 76a714eac102e58b29a7fbf76bffd98074b7a3762cabe8a45bd728c0e3c6dae5
         | 
| 4 | 
            +
              data.tar.gz: e4089d64477e6f9e0d0c64f7066e532a59fc762cfba3562ff0af898b5838520e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 25c5a2757ee1bebd13c8bab15672d097348619900020961fb0c835fdc5fa16fdcce570862a66ab187bfa4ed9b7f6b37573fc5a9e7b6c2bc1e350a22f4819cc1f
         | 
| 7 | 
            +
              data.tar.gz: a16f7741281e5f4a01c2c318f25d32669739d45df8fbfca1efa151ebdafb7cdd36f117c45b484d5b91a7e3fa04b8c3424245200dd2fdb8c83769e1844a260326
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/Appraisals
    CHANGED
    
    | @@ -3,9 +3,9 @@ appraise "rails-5-2" do | |
| 3 3 | 
             
              gem "sqlite3", "~> 1.3.13"
         | 
| 4 4 |  | 
| 5 5 | 
             
              group :development, :test do
         | 
| 6 | 
            -
                gem 'factory_girl_rails', : | 
| 7 | 
            -
                gem 'rspec-rails', "~> | 
| 8 | 
            -
                gem 'database_cleaner', : | 
| 6 | 
            +
                gem 'factory_girl_rails', require: false
         | 
| 7 | 
            +
                gem 'rspec-rails', "~> 5.0.0", require: false
         | 
| 8 | 
            +
                gem 'database_cleaner', require: false
         | 
| 9 9 | 
             
              end
         | 
| 10 10 | 
             
            end if RUBY_VERSION.to_f < 3.0
         | 
| 11 11 |  | 
| @@ -15,8 +15,32 @@ appraise "rails-6" do | |
| 15 15 | 
             
              gem "net-smtp"
         | 
| 16 16 |  | 
| 17 17 | 
             
              group :development, :test do
         | 
| 18 | 
            -
                gem 'factory_girl_rails', : | 
| 19 | 
            -
                gem 'rspec-rails', "~> | 
| 20 | 
            -
                gem 'database_cleaner', : | 
| 18 | 
            +
                gem 'factory_girl_rails', require: false
         | 
| 19 | 
            +
                gem 'rspec-rails', "~> 5.0.0", require: false
         | 
| 20 | 
            +
                gem 'database_cleaner', require: false
         | 
| 21 21 | 
             
              end
         | 
| 22 | 
            -
            end if RUBY_VERSION.to_f >= 2.5
         | 
| 22 | 
            +
            end if RUBY_VERSION.to_f >= 2.5
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            appraise "rails-7" do
         | 
| 25 | 
            +
              gem "rails", "~> 7.0.8"
         | 
| 26 | 
            +
              gem "sqlite3", "~> 1.4"
         | 
| 27 | 
            +
              gem "net-smtp"
         | 
| 28 | 
            +
             | 
| 29 | 
            +
              group :development, :test do
         | 
| 30 | 
            +
                gem 'factory_girl_rails', require: false
         | 
| 31 | 
            +
                gem 'rspec-rails', "~> 7.0.0", require: false
         | 
| 32 | 
            +
                gem 'database_cleaner', require: false
         | 
| 33 | 
            +
              end
         | 
| 34 | 
            +
            end if RUBY_VERSION.to_f >= 2.7
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            appraise "rails-7-1" do
         | 
| 37 | 
            +
              gem "rails", "~> 7.1.5"
         | 
| 38 | 
            +
              gem "sqlite3", "~> 1.4"
         | 
| 39 | 
            +
              gem "net-smtp"
         | 
| 40 | 
            +
             | 
| 41 | 
            +
              group :development, :test do
         | 
| 42 | 
            +
                gem 'factory_girl_rails', require: false
         | 
| 43 | 
            +
                gem 'rspec-rails', "~> 7.1.0", require: false
         | 
| 44 | 
            +
                gem 'database_cleaner', require: false
         | 
| 45 | 
            +
              end
         | 
| 46 | 
            +
            end if RUBY_VERSION.to_f >= 2.7
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -5,6 +5,14 @@ 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 | 
            +
            ## [0.2.1] - 2024-12-29
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            ### Changed
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            - Added apprasials for testing against Rails 7 and Rails 7.1
         | 
| 13 | 
            +
            - Bump rspec-rails version from "~>4.0.0.beta3" to "~> 5.0.0" for Rails 5.2 and Rails 6 testing
         | 
| 14 | 
            +
            - Updated README to move the authy migration instructions a bit below the README gem introduction / instructions
         | 
| 15 | 
            +
             | 
| 8 16 | 
             
            ## [0.2.0] - 2024-12-21
         | 
| 9 17 |  | 
| 10 18 | 
             
            ### Changed
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,45 +1,4 @@ | |
| 1 | 
            -
            #  | 
| 2 | 
            -
             | 
| 3 | 
            -
            ### This gem is meant to be a drop-in replacement for devise-authy in a Rails app (minus the following features)
         | 
| 4 | 
            -
            - Currently only support mobile phones with US country codes
         | 
| 5 | 
            -
            - Removed Onetouch support
         | 
| 6 | 
            -
            - Removed ability to request a phone call
         | 
| 7 | 
            -
             | 
| 8 | 
            -
            ### Just follow the steps below to migrate:
         | 
| 9 | 
            -
            - Swap out `devise-authy` in your Gemfile with `devise-twilio-verify`
         | 
| 10 | 
            -
            - `gem 'devise-twilio-verify'
         | 
| 11 | 
            -
            - Setup a Twilio Verify account
         | 
| 12 | 
            -
            - Add env vars and/or Rails credentials for:
         | 
| 13 | 
            -
              - `TWILIO_AUTH_TOKEN`
         | 
| 14 | 
            -
              - `TWILIO_ACCOUNT_SID`
         | 
| 15 | 
            -
              - `TWILIO_VERIFY_SERVICE_SID`
         | 
| 16 | 
            -
            - Create/run a migration to rename  and add the following columns
         | 
| 17 | 
            -
              ```ruby
         | 
| 18 | 
            -
                class MigrateAuthyToTwilioVerify < ActiveRecord::Migration[6.1]
         | 
| 19 | 
            -
                  def change
         | 
| 20 | 
            -
                    rename_column :users, :authy_sms, :twilio_verify_sms
         | 
| 21 | 
            -
                    rename_column :users, :authy_enabled, :twilio_verify_enabled
         | 
| 22 | 
            -
                    rename_column :users, :last_sign_in_with_authy, :last_sign_in_with_twilio_verify
         | 
| 23 | 
            -
                    add_column :users, :twilio_totp_factor_sid, :string
         | 
| 24 | 
            -
                  end
         | 
| 25 | 
            -
                end
         | 
| 26 | 
            -
             | 
| 27 | 
            -
              ```
         | 
| 28 | 
            -
            - you can also delete the `users.authy_id` column if you choose
         | 
| 29 | 
            -
            - Twilio Verify service sms will be sent to `users.mobile_phone`, so make sure you store the users 2fa phone number in this column, can make this field name dynamic in the future
         | 
| 30 | 
            -
            - Do a project code wide search & replace of these terms
         | 
| 31 | 
            -
              - `devise-authy` -> `devise-twilio-verify`
         | 
| 32 | 
            -
              - `authy_` -> `twilio_verify_`
         | 
| 33 | 
            -
              -  `_authy` -> `_twilio_verify`
         | 
| 34 | 
            -
              -  `authy-` -> `twilio-verify-`
         | 
| 35 | 
            -
              -  `-authy` -> `-twilio-verify`
         | 
| 36 | 
            -
              -  `Authy` -> `TwilioVerify`
         | 
| 37 | 
            -
            - Do a project file search & replace of any file with authy in the name (here's a few examples to replace)
         | 
| 38 | 
            -
              - app/javascript/src/deviseTwilioVerify.js
         | 
| 39 | 
            -
              - app/assets/stylesheets/devise_twilio_verify.scss
         | 
| 40 | 
            -
              - config/locales/devise.twilio_verify.en.yml
         | 
| 41 | 
            -
             | 
| 42 | 
            -
            # Twilio Verify Devise [](https://github.com/twilio/authy-devise/actions)
         | 
| 1 | 
            +
            # Twilio Verify Devise [](https://github.com/jayywolff/twilio-verify-devise/actions)
         | 
| 43 2 |  | 
| 44 3 | 
             
            This is a [Devise](https://github.com/heartcombo/devise) extension to add [Two-Factor Authentication with Twilio Verify](https://www.twilio.com/docs/verify) to your Rails application.
         | 
| 45 4 |  | 
| @@ -48,10 +7,9 @@ Please visit the Twilio Docs for more information: | |
| 48 7 | 
             
            * [Verify + Ruby (Rails) quickstart](https://www.twilio.com/docs/verify/quickstarts/ruby-rails)
         | 
| 49 8 | 
             
            * [Twilio Ruby helper library](https://www.twilio.com/docs/libraries/ruby)
         | 
| 50 9 | 
             
            * [Verify API reference](https://www.twilio.com/docs/verify/api)
         | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 10 | 
            +
            * [Migrate Authy to Twilio Verify API](#migrate-authy-to-twilio-verify-api)
         | 
| 53 11 | 
             
            * [Pre-requisites](#pre-requisites)
         | 
| 54 | 
            -
            * [Demo](#demo)
         | 
| 12 | 
            +
            * [Demo (TODO)](#demo)
         | 
| 55 13 | 
             
            * [Getting started](#getting-started)
         | 
| 56 14 | 
             
              * [Configuring Models](#configuring-models)
         | 
| 57 15 | 
             
                * [With the generator](#with-the-generator)
         | 
| @@ -246,7 +204,7 @@ This will display a QR code on the verification screen (you still need to take a | |
| 246 204 |  | 
| 247 205 | 
             
            In Rails 5 `protect_from_forgery` is no longer prepended to the `before_action` chain. If you call `authenticate_user` before `protect_from_forgery` your request will result in a "Can't verify CSRF token authenticity" error.
         | 
| 248 206 |  | 
| 249 | 
            -
            To remedy this, add `prepend: true` to your `protect_from_forgery` call | 
| 207 | 
            +
            To remedy this, add `prepend: true` to your `protect_from_forgery` call
         | 
| 250 208 |  | 
| 251 209 | 
             
            ```ruby
         | 
| 252 210 | 
             
            class ApplicationController < ActionController::Base
         | 
| @@ -262,5 +220,47 @@ Run the following command: | |
| 262 220 | 
             
            $ bundle exec rspec
         | 
| 263 221 | 
             
            ```
         | 
| 264 222 |  | 
| 223 | 
            +
            ## Migrate Authy to Twilio Verify API
         | 
| 224 | 
            +
             | 
| 225 | 
            +
            ### This gem is meant to be a drop-in replacement for devise-authy in a Rails app (minus the following features)
         | 
| 226 | 
            +
            - Currently supports SMS and TOTP 2FA
         | 
| 227 | 
            +
            - Currently only support mobile phones with US country codes
         | 
| 228 | 
            +
            - Removed Onetouch support
         | 
| 229 | 
            +
            - Removed ability to request a phone call
         | 
| 230 | 
            +
             | 
| 231 | 
            +
            ### Just follow the steps below to migrate:
         | 
| 232 | 
            +
            - Swap out `devise-authy` in your Gemfile with `devise-twilio-verify`
         | 
| 233 | 
            +
            - `gem 'devise-twilio-verify'
         | 
| 234 | 
            +
            - Setup a Twilio Verify account
         | 
| 235 | 
            +
            - Add env vars and/or Rails credentials for:
         | 
| 236 | 
            +
              - `TWILIO_AUTH_TOKEN`
         | 
| 237 | 
            +
              - `TWILIO_ACCOUNT_SID`
         | 
| 238 | 
            +
              - `TWILIO_VERIFY_SERVICE_SID`
         | 
| 239 | 
            +
            - Create/run a migration to rename  and add the following columns
         | 
| 240 | 
            +
              ```ruby
         | 
| 241 | 
            +
                class MigrateAuthyToTwilioVerify < ActiveRecord::Migration[6.1]
         | 
| 242 | 
            +
                  def change
         | 
| 243 | 
            +
                    rename_column :users, :authy_sms, :twilio_verify_sms
         | 
| 244 | 
            +
                    rename_column :users, :authy_enabled, :twilio_verify_enabled
         | 
| 245 | 
            +
                    rename_column :users, :last_sign_in_with_authy, :last_sign_in_with_twilio_verify
         | 
| 246 | 
            +
                    add_column :users, :twilio_totp_factor_sid, :string
         | 
| 247 | 
            +
                  end
         | 
| 248 | 
            +
                end
         | 
| 249 | 
            +
             | 
| 250 | 
            +
              ```
         | 
| 251 | 
            +
            - you can also delete the `users.authy_id` column if you choose
         | 
| 252 | 
            +
            - Twilio Verify service sms will be sent to `users.mobile_phone`, so make sure you store the users 2fa phone number in this column, can make this field name dynamic in the future
         | 
| 253 | 
            +
            - Do a project code wide search & replace of these terms
         | 
| 254 | 
            +
              - `devise-authy` -> `devise-twilio-verify`
         | 
| 255 | 
            +
              - `authy_` -> `twilio_verify_`
         | 
| 256 | 
            +
              -  `_authy` -> `_twilio_verify`
         | 
| 257 | 
            +
              -  `authy-` -> `twilio-verify-`
         | 
| 258 | 
            +
              -  `-authy` -> `-twilio-verify`
         | 
| 259 | 
            +
              -  `Authy` -> `TwilioVerify`
         | 
| 260 | 
            +
            - Do a project file search & replace of any file with authy in the name (here's a few examples to replace)
         | 
| 261 | 
            +
              - app/javascript/src/deviseTwilioVerify.js
         | 
| 262 | 
            +
              - app/assets/stylesheets/devise_twilio_verify.scss
         | 
| 263 | 
            +
              - config/locales/devise.twilio_verify.en.yml
         | 
| 264 | 
            +
             | 
| 265 265 | 
             
            ## Copyright
         | 
| 266 266 | 
             
            See LICENSE.txt for further details.
         | 
    
        data/gemfiles/rails_5_2.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_6.gemfile
    CHANGED
    
    
| @@ -0,0 +1,15 @@ | |
| 1 | 
            +
            # This file was generated by Appraisal
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            source "https://rubygems.org"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            gem "rails", "~> 7.0.8"
         | 
| 6 | 
            +
            gem "sqlite3", "~> 1.4"
         | 
| 7 | 
            +
            gem "net-smtp"
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            group :development, :test do
         | 
| 10 | 
            +
              gem "factory_girl_rails", require: false
         | 
| 11 | 
            +
              gem "rspec-rails", "~> 7.0.0", require: false
         | 
| 12 | 
            +
              gem "database_cleaner", require: false
         | 
| 13 | 
            +
            end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            gemspec path: "../"
         | 
| @@ -0,0 +1,15 @@ | |
| 1 | 
            +
            # This file was generated by Appraisal
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            source "https://rubygems.org"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            gem "rails", "~> 7.1.5"
         | 
| 6 | 
            +
            gem "sqlite3", "~> 1.4"
         | 
| 7 | 
            +
            gem "net-smtp"
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            group :development, :test do
         | 
| 10 | 
            +
              gem "factory_girl_rails", require: false
         | 
| 11 | 
            +
              gem "rspec-rails", "~> 7.1.0", require: false
         | 
| 12 | 
            +
              gem "database_cleaner", require: false
         | 
| 13 | 
            +
            end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            gemspec path: "../"
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: devise-twilio-verify
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jay Wolff
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024-12- | 
| 11 | 
            +
            date: 2024-12-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: devise
         | 
| @@ -340,6 +340,8 @@ files: | |
| 340 340 | 
             
            - gemfiles/.bundle/config
         | 
| 341 341 | 
             
            - gemfiles/rails_5_2.gemfile
         | 
| 342 342 | 
             
            - gemfiles/rails_6.gemfile
         | 
| 343 | 
            +
            - gemfiles/rails_7.gemfile
         | 
| 344 | 
            +
            - gemfiles/rails_7_1.gemfile
         | 
| 343 345 | 
             
            - lib/devise-twilio-verify.rb
         | 
| 344 346 | 
             
            - lib/devise-twilio-verify/controllers/helpers.rb
         | 
| 345 347 | 
             
            - lib/devise-twilio-verify/controllers/view_helpers.rb
         |