devise_fido_usf 0.1.8 → 0.1.13

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
- SHA1:
3
- metadata.gz: 96c8b3e2463da3287d1e62f498c6ad481a98e928
4
- data.tar.gz: ef2e2c7a249c4ceef0d07f2d121b45be1ae0d491
2
+ SHA256:
3
+ metadata.gz: '0168a30db4bb76ae498979b9310a7d25dca7248ce86fc76e56f552b57031bf65'
4
+ data.tar.gz: 704575b770554dedb323080ad2a9f9dbedd69fe67c65041e8659ce4ba6a676b4
5
5
  SHA512:
6
- metadata.gz: f2b0854980aacbbc4480475d193ba47ec360f4b72729895303bbf8935d5225c38c7c63d95d52c6ce615518f430b0e7c9ef80c6d4c5e4a3c258cfce69edc42130
7
- data.tar.gz: a8be7220ea71e7e0aa9655403fe0e639994a9ed4607530ecfcdebacdf2e65481bccc7185663fbc58a35eb6adc37f31a8196ee7b11e7cd9fd88c0fadb08214e72
6
+ metadata.gz: 92573881a7376c78f085dc347dceb3e6966ab13195398bee0fd37c75253303be6b4e5ffcbb69a86d700dfe9771eba87e65e253bf899e4fe40f15be8349105eac
7
+ data.tar.gz: 0e0596d1f7959924cdd0384d3f685f0effda318fff068bf3f0920877ab9875a194743bd65f136eccfe08a1a7602d2bc32336b98bdacca2cc1e30251ad58d96a2
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # FIDO U2F Authentication for Rails Devise
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/devise_fido_usf.svg)](https://badge.fury.io/rb/devise_fido_usf)
4
- [![Dependency Status](https://gemnasium.com/badges/github.com/CyberDeck/devise-fido-u2f.svg)](https://gemnasium.com/github.com/CyberDeck/devise-fido-u2f)
5
4
  [![Build Status](https://travis-ci.org/CyberDeck/devise-fido-u2f.svg?branch=master)](https://travis-ci.org/CyberDeck/devise-fido-u2f)
6
5
  [![Code Climate](https://codeclimate.com/github/CyberDeck/devise-fido-u2f/badges/gpa.svg)](https://codeclimate.com/github/CyberDeck/devise-fido-u2f)
7
6
  [![Coverage Status](https://coveralls.io/repos/github/CyberDeck/devise-fido-u2f/badge.svg)](https://coveralls.io/github/CyberDeck/devise-fido-u2f)
@@ -66,7 +65,7 @@ You can install the `devise_fido_usf` views by running
66
65
  rails generate devise_fido_usf:views
67
66
  ```
68
67
 
69
- After that, you need to adapt the views to your needs. Take a look at the ![Devise FIDO U2F example app](https://github.com/cyberdeck/devise-fido-u2f-example-app) how it could be integrated into a Rails 5.1 application running Bootstrap v4.
68
+ After that, you need to adapt the views to your needs. Take a look at the [Devise FIDO U2F example app](https://github.com/cyberdeck/devise-fido-u2f-example-app) how it could be integrated into a Rails 5.1 application running Bootstrap v4.
70
69
 
71
70
  ## Contributing
72
71
  This is my first developed and published gem. If you find something unusual or uncommon within my code, please drop me a note how to fix it or make it better. Thank you!
@@ -1,6 +1,8 @@
1
1
  class Devise::FidoUsfRegistrationsController < ApplicationController
2
2
  before_action :authenticate_resource!
3
3
 
4
+ respond_to :html
5
+
4
6
  def new
5
7
  @registration_requests = u2f.registration_requests
6
8
  session[:challenges] = @registration_requests.map(&:challenge)
@@ -55,10 +57,7 @@ class Devise::FidoUsfRegistrationsController < ApplicationController
55
57
  session.delete(:challenges)
56
58
  end
57
59
 
58
- respond_to do |format|
59
- format.js
60
- format.html { redirect_to fido_usf_registration_url }
61
- end
60
+ respond_with resource, location: after_sign_in_path_for(resource)
62
61
  end
63
62
 
64
63
  def update
@@ -1,11 +1,11 @@
1
1
  <h2>Authenticate key</h2>
2
2
  <p>Please insert one of your registered keys and press the button within 15 seconds</p>
3
3
  <p id="waiting">Waiting...</p>
4
- <p id="error" style="display: none;"></p>
4
+ <p id="error" class="d-none"></p>
5
5
  <%= form_tag send("#{resource_name}_fido_usf_authentication_path"), method: 'post' do %>
6
6
  <%= hidden_field_tag :response %>
7
7
  <% end %>
8
- <script>
8
+ <%= javascript_tag nonce: true do -%>
9
9
  var appId = <%= @app_id.to_json.html_safe %>;
10
10
  var signRequests = <%= @sign_requests.to_json.html_safe %>;
11
11
  var challenge = <%= @challenge.to_json.html_safe %>;
@@ -19,8 +19,8 @@
19
19
  5: 'Authentication timed out. Please reload to try again.'
20
20
  };
21
21
  var setError = function(code) {
22
- $waiting.style.display = 'none';
23
- $error.style.display = 'block';
22
+ $waiting.className += ' d-none';
23
+ $error.className = $error.className.replace(/\bd-none\b/g, '');
24
24
  $error.innerHTML = errorMap[code];
25
25
  };
26
26
 
@@ -38,4 +38,4 @@
38
38
 
39
39
  form.submit();
40
40
  }, 15);
41
- </script>
41
+ <% end -%>
@@ -1,13 +1,13 @@
1
1
  <h2>Register key</h2>
2
2
  <p>Please insert the key and press the button within 15 seconds</p>
3
3
  <p id="waiting">Waiting...</p>
4
- <p id="error" style="display: none;"></p>
4
+ <p id="error" class="d-none"></p>
5
5
 
6
6
  <%= form_tag send("#{resource_name}_fido_usf_registration_path"), method: 'post' do %>
7
7
  <%= hidden_field_tag :response %>
8
8
  <% end %>
9
9
 
10
- <script>
10
+ <%= javascript_tag nonce: true do -%>
11
11
  var appId = <%= @app_id.to_json.html_safe %>;
12
12
  var registerRequests = <%= @registration_requests.to_json.html_safe %>;
13
13
  var signRequests = <%= @sign_requests.to_json.html_safe %>;
@@ -21,8 +21,8 @@
21
21
  5: 'Authentication timed out. Please reload to try again.'
22
22
  };
23
23
  var setError = function(code) {
24
- $waiting.style.display = 'none';
25
- $error.style.display = 'block';
24
+ $waiting.className += ' d-none';
25
+ $error.className = $error.className.replace(/\bd-none\b/g, '');
26
26
  $error.innerHTML = errorMap[code];
27
27
  };
28
28
 
@@ -40,4 +40,4 @@
40
40
 
41
41
  form.submit();
42
42
  }, 15);
43
- </script>
43
+ <% end -%>
@@ -1,3 +1,3 @@
1
1
  module DeviseFidoUsf
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.13'
3
3
  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.8
4
+ version: 0.1.13
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: 2018-01-01 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -242,10 +242,14 @@ files:
242
242
  - lib/generators/templates/README
243
243
  - lib/generators/templates/migration.rb
244
244
  - lib/tasks/devise_fido_usf_tasks.rake
245
- homepage: https://github.com/CyberDeck/devise-fido-u2f/
245
+ homepage: https://github.com/CyberDeck/devise-fido-u2f
246
246
  licenses:
247
247
  - MIT
248
- metadata: {}
248
+ metadata:
249
+ homepage_uri: https://github.com/cyberdeck/devise-fido-u2f
250
+ changelog_uri: https://github.com/cyberdeck/devise-fido-u2f/blob/master/CHANGELOG.md
251
+ source_code_uri: https://github.com/cyberdeck/devise-fido-u2f/
252
+ bug_tracker_uri: https://github.com/cyberdeck/devise-fido-u2f/issues
249
253
  post_install_message:
250
254
  rdoc_options: []
251
255
  require_paths:
@@ -261,8 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
265
  - !ruby/object:Gem::Version
262
266
  version: '0'
263
267
  requirements: []
264
- rubyforge_project:
265
- rubygems_version: 2.5.2
268
+ rubygems_version: 3.0.3
266
269
  signing_key:
267
270
  specification_version: 4
268
271
  summary: A Devise module to allow FIDO U2F authentication.