devise_fido_usf 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7c08c46417abf8bb8ee7e86fe62ca680de00e00
4
- data.tar.gz: 8e7156d2787de596959d0c1c058011184117a153
3
+ metadata.gz: d207ffcd280ad9e22acb9449817c1cceed37033f
4
+ data.tar.gz: 195175812d70102cab632d53a941f5cc4bd83112
5
5
  SHA512:
6
- metadata.gz: 7d7eba4cbae06efeafbfa510055ece1f1caa2ef29a3357e7e67f120f3b7a64cb7da940b9daa986692c3521293b8eb2024ac325df45240077fa802322596cab98
7
- data.tar.gz: a0bac4db40ad751bde9c9ddcf88201831c38cb192ebb387e9abd890ae85767eabc4c4fa5008dc21ca0f9cde2e3e26f2c1a14a211dd58c06fa5ba2351f2e72e1e
6
+ metadata.gz: 71c52c69ba85bd448502bc7cfe9a2fe4c95ac95dcc3e0b6a03a4015c54e4e7f68b1e46e1aeaf3340a0796ae1d557d9f6d7b7e0331812d02364a982fa33e549b6
7
+ data.tar.gz: 6a9ac55b35386da8415af1c3f304ff96cbea3b76e1728e18ebd376a997a988ceda8f666549bef86358273112211b4032bc72bdff9b86d690f03a61c8592fba3a
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # FIDO U2F Authentication for Rails Devise
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/devise_fido_usf.svg)](https://badge.fury.io/rb/devise_fido_usf)
3
4
  [![Dependency Status](https://gemnasium.com/badges/github.com/CyberDeck/devise-fido-u2f.svg)](https://gemnasium.com/github.com/CyberDeck/devise-fido-u2f)
4
5
  [![Security](https://hakiri.io/github/CyberDeck/devise-fido-u2f/master.svg)](https://hakiri.io/github/CyberDeck/devise-fido-u2f/master)
5
6
 
@@ -1,3 +1,3 @@
1
1
  module DeviseFidoUsf
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -53,6 +53,14 @@ module DeviseFidoUsf
53
53
  end
54
54
  RUBY
55
55
  end
56
+
57
+ private
58
+
59
+ def inject_into_module(path, module_name, *args, &block)
60
+ config = args.last.is_a?(Hash) ? args.pop : {}
61
+ config[:after] = /module #{module_name}\n|module #{module_name} .*\n/
62
+ insert_into_file(path, *(args << config), &block)
63
+ end
56
64
  end
57
65
  end
58
66
  end
@@ -0,0 +1,40 @@
1
+ require 'rails/generators/base'
2
+
3
+ module DeviseFidoUsf
4
+ module Generators
5
+ class ViewsGenerator < Rails::Generators::Base
6
+ source_root File.expand_path("../../../../app/views/devise", __FILE__)
7
+
8
+ desc "Copies devise-fido-u2f views to your application."
9
+
10
+
11
+ argument :scope, required: false, default: nil,
12
+ desc: "The scope to copy views to"
13
+
14
+ def copy_views
15
+ view_directory :fido_usf_authentications
16
+ view_directory :fido_usf_registrations
17
+ end
18
+
19
+ protected
20
+
21
+ def view_directory(name, _target_path = nil)
22
+ directory name.to_s, _target_path || "#{target_path}/#{name}" do |content|
23
+ if scope
24
+ content.gsub "devise/fido_usf_registrations/device", "#{plural_scope}/fido_usf_registrations/device"
25
+ else
26
+ content
27
+ end
28
+ end
29
+ end
30
+
31
+ def target_path
32
+ @target_path ||= "app/views/#{plural_scope || :devise}"
33
+ end
34
+
35
+ def plural_scope
36
+ @plural_scope ||= scope.presence && scope.underscore.pluralize
37
+ end
38
+ end
39
+ end
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_fido_usf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - H. Gregor Molter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-08 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '4.2'
33
+ version: '4.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: '4.2'
40
+ version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: u2f
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -210,6 +210,7 @@ files:
210
210
  - lib/devise_fido_usf/version.rb
211
211
  - lib/generators/devise_fido_usf/install_generator.rb
212
212
  - lib/generators/devise_fido_usf/migrate_generator.rb
213
+ - lib/generators/devise_fido_usf/views_generator.rb
213
214
  - lib/generators/templates/README
214
215
  - lib/generators/templates/migration.rb
215
216
  - lib/tasks/devise_fido_usf_tasks.rake
@@ -233,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
234
  version: '0'
234
235
  requirements: []
235
236
  rubyforge_project:
236
- rubygems_version: 2.5.2
237
+ rubygems_version: 2.5.1
237
238
  signing_key:
238
239
  specification_version: 4
239
240
  summary: A Devise module to allow FIDO U2F authentication.