devise_fido_usf 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/app/views/devise/fido_usf_registrations/destroy.js.erb +2 -2
- data/app/views/devise/fido_usf_registrations/show.html.erb +3 -3
- data/lib/devise_fido_usf/controllers/helpers.rb +2 -1
- data/lib/devise_fido_usf/models/fido_usf_authenticatable.rb +2 -3
- data/lib/devise_fido_usf/models/fido_usf_registerable.rb +0 -1
- data/lib/devise_fido_usf/rails.rb +0 -1
- data/lib/devise_fido_usf/routes.rb +17 -10
- data/lib/devise_fido_usf/version.rb +1 -1
- metadata +36 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6818c646ee1328a03e416afb48e95a3249a24093
|
4
|
+
data.tar.gz: 5363ecb84e7f86b72ed9de132c10c11e9c1e8367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f9f9e9ea7abe3caf6c7ee5b54da01ad66d7cde4fbdeac61d4ea5730c8927974f1cbee27cbce71da740ab16e53eda309d914484ca8bb18d28aafa402b510a000
|
7
|
+
data.tar.gz: 3c9f2e4522e85de76327404fde6471afe51e37b759c2226daef855d08ea0d33c08c95e4308cd9205671ba100ffca6fe3ca6d41a608ee9850ff95d6d438fc1ee9
|
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/devise_fido_usf.svg)](https://badge.fury.io/rb/devise_fido_usf)
|
4
4
|
[![Dependency Status](https://gemnasium.com/badges/github.com/CyberDeck/devise-fido-u2f.svg)](https://gemnasium.com/github.com/CyberDeck/devise-fido-u2f)
|
5
|
-
[![Security](https://hakiri.io/github/CyberDeck/devise-fido-u2f/master.svg)](https://hakiri.io/github/CyberDeck/devise-fido-u2f/master)
|
6
|
-
|
7
5
|
[![Build Status](https://travis-ci.org/CyberDeck/devise-fido-u2f.svg?branch=master)](https://travis-ci.org/CyberDeck/devise-fido-u2f)
|
8
6
|
[![Code Climate](https://codeclimate.com/github/CyberDeck/devise-fido-u2f/badges/gpa.svg)](https://codeclimate.com/github/CyberDeck/devise-fido-u2f)
|
9
7
|
[![Coverage Status](https://coveralls.io/repos/github/CyberDeck/devise-fido-u2f/badge.svg)](https://coveralls.io/github/CyberDeck/devise-fido-u2f)
|
@@ -11,7 +9,7 @@
|
|
11
9
|
A gem which allows Rails Devise users to authenticate against a second factor.
|
12
10
|
|
13
11
|
## Getting started
|
14
|
-
Devise FIDO U2F works with Rails
|
12
|
+
Devise FIDO U2F works with Rails 4.2 or newer and Devise 3.2 onwards. You need to add it to your application's Gemfile with:
|
15
13
|
|
16
14
|
```ruby
|
17
15
|
gem 'devise_fido_usf'
|
@@ -1,3 +1,3 @@
|
|
1
|
-
$('#device_<%= @fade_out_id %>').fadeOut(400, function () {
|
2
|
-
$('#devices').html('<%= j(render(partial:
|
1
|
+
$('#device_<%= @fade_out_id %>').fadeOut(400, function () {
|
2
|
+
$('#devices').html('<%= j(render(partial: "devise/fido_usf_registrations/device", collection: @devices)) %>')
|
3
3
|
} );
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<h2>
|
1
|
+
<h2>FIDO U2F Devices</h2>
|
2
2
|
<p>List of registered devices:</p>
|
3
3
|
<%= render 'devise/fido_usf_registrations/devices' %>
|
4
|
-
<p><%= link_to 'Back', root_path
|
5
|
-
<p><%= link_to 'Add', new_user_fido_usf_registration_path
|
4
|
+
<p><%= link_to 'Back', root_path %></p>
|
5
|
+
<p><%= link_to 'Add', new_user_fido_usf_registration_path %></p>
|
@@ -6,7 +6,8 @@ module DeviseFidoUsf
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
-
before_action :check_request_and_redirect_to_verify_fido_usf,
|
9
|
+
before_action :check_request_and_redirect_to_verify_fido_usf,
|
10
|
+
if: :is_user_signing_in?
|
10
11
|
end
|
11
12
|
|
12
13
|
private
|
@@ -6,10 +6,9 @@ module Devise
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
# Does the user has a registered FIDO U2F device?
|
9
|
-
def with_fido_usf_authentication?
|
10
|
-
FidoUsf::FidoUsfDevice.where(user: self).count
|
9
|
+
def with_fido_usf_authentication?
|
10
|
+
FidoUsf::FidoUsfDevice.where(user: self).count > 0
|
11
11
|
end
|
12
|
-
|
13
12
|
end
|
14
13
|
end
|
15
14
|
end
|
@@ -1,15 +1,22 @@
|
|
1
|
-
module ActionDispatch
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module ActionDispatch
|
2
|
+
module Routing
|
3
|
+
#
|
4
|
+
# Routes to register U2F devices and to authenticate with a U2F device
|
5
|
+
#
|
6
|
+
class Mapper
|
7
|
+
def devise_fido_usf_registration(mapping, controllers)
|
8
|
+
resource :fido_usf_registration,
|
9
|
+
only: %i[show new create update destroy],
|
10
|
+
path: mapping.path_names[:fido_usf_registration],
|
11
|
+
controller: controllers[:fido_usf_registrations]
|
6
12
|
end
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
13
|
+
|
14
|
+
def devise_fido_usf_authentication(mapping, controllers)
|
15
|
+
resource :fido_usf_authentication,
|
16
|
+
only: %i[new create],
|
17
|
+
path: mapping.path_names[:fido_usf_authentication],
|
18
|
+
controller: controllers[:fido_usf_authentications]
|
11
19
|
end
|
12
20
|
end
|
13
21
|
end
|
14
22
|
end
|
15
|
-
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_fido_usf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
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-
|
11
|
+
date: 2017-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: devise
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '4.
|
33
|
+
version: '4.2'
|
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.
|
40
|
+
version: '4.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.20.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.20.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: u2f
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 1.0.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 1.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sqlite3
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,6 +192,20 @@ dependencies:
|
|
192
192
|
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: nokogiri
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: 1.8.1
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 1.8.1
|
195
209
|
description: Enables a Rails Devise app to authenticate users with a second factor,
|
196
210
|
e.g. a FIDO U2F compatible hardware token.
|
197
211
|
email:
|