clarion 1.0.0 → 1.1.0

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
  SHA256:
3
- metadata.gz: 1be5cccde62a2aa7db2fc08a6f55f872779c0745da3daff77a04d8ae2f28e77d
4
- data.tar.gz: 4cbd2bd4368caf6487a79a79977eb0f82b3c19cb1c10741237e27132774eeb7b
3
+ metadata.gz: 84a30b16b873057c9f6f6831b5a11827eef098caddaf3a4cb19047f081eb2ebb
4
+ data.tar.gz: cf47f7b89067fe1438a94f67556a6240feb17ea5e22968318bd6ab1b1ba3bec8
5
5
  SHA512:
6
- metadata.gz: 7bf00fbb11b976a954b09bb26fe950dcfccb40eed66b6a2dda726d83ef7e27400913f31058fa68f8e8328a746be06157223ef520507aa490e109d46c5d2db234
7
- data.tar.gz: 5a0956255f6f737367476f3294d944b5761beaf8ade31524c4b3f46278c8ac3bdc6d554c3c43630cf962ef8e1fcfdce17c00ebc9c224a1956854b3d6163e364d
6
+ metadata.gz: 1d837f20219b82a12bc833268fe5edf9ebeb138013ff2f3481993ea6cb4ddaf3a214835f9c64f0775678cec3b2bf65dc2c62033806358707eac5434c6db916ca
7
+ data.tar.gz: a2cd1b1a58cba9438a46dd6a886ddb6c97a2382d4e4f4c8547a0dea11d6c493a468efe0e51464bec6e31cfa30554a91f1614e09f7f4ecfd471c88f312d9ef8c0
@@ -7,6 +7,7 @@ document.addEventListener("DOMContentLoaded", async function() {
7
7
  processionElem.className = 'procession_unsupported';
8
8
  };
9
9
  if (!navigator.credentials) return handleUnsupported();
10
+ if (!window.PublicKeyCredential) return handleUnsupported();
10
11
 
11
12
  const regId = processionElem.attributes['data-reg-id'].value;
12
13
  const state = processionElem.attributes['data-state'].value;
@@ -19,6 +20,25 @@ document.addEventListener("DOMContentLoaded", async function() {
19
20
 
20
21
  let attestation;
21
22
 
23
+ // "Force platform authenticator" link; This is especially for Chrome 70 Touch ID support.
24
+ // Until the WebAuthn dialog https://crbug.com/847985 is rolled out, the platform authenticators are needed to be chosen
25
+ // explicitly to enable Touch ID authenticator.
26
+ if (window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable) {
27
+ const platformAuthenticatorAvailability = await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
28
+ if (platformAuthenticatorAvailability && location.hash == '#platform') {
29
+ creationOptions.publicKey.authenticatorSelection = {authenticatorAttachment: 'platform'};
30
+ } else if (platformAuthenticatorAvailability) {
31
+ document.querySelector('#force_platform_link').addEventListener('click', function(e) {
32
+ e.target.remove();
33
+ e.preventDefault();
34
+ // https://crbug.com/803833
35
+ location.hash = '#platform';
36
+ location.reload();
37
+ });
38
+ document.body.classList.add('platform-authenticator-available');
39
+ }
40
+ }
41
+
22
42
  const startCreationRequest = async function() {
23
43
  processionElem.className = 'procession_wait';
24
44
 
@@ -85,4 +85,4 @@
85
85
  </div>
86
86
 
87
87
 
88
- <script src="/sign.js"></script>
88
+ <script src="/sign.js?<%= Clarion::VERSION %>"></script>
@@ -26,6 +26,8 @@
26
26
  #procession.procession_timeout > div.procession_timeout {
27
27
  display: block;
28
28
  }
29
+ #force_platform_link { display: none; }
30
+ body.platform-authenticator-available #force_platform_link { display: inline; }
29
31
  </style>
30
32
 
31
33
  <p><strong>U2F key registration<%- if @name -%> for <%= @name %><%- end -%></strong></p>
@@ -42,6 +44,7 @@
42
44
  </div>
43
45
  <div class="procession_wait">
44
46
  <p>Insert and tap your security key.</p>
47
+ <p class='right'><a href='#' id="force_platform_link" class='text-muted'><small>Force platform authenticator (May enable Touch ID)</small></a></p>
45
48
  </div>
46
49
  <div class="procession_edit">
47
50
  <p>Security key recognized:</p>
@@ -73,4 +76,4 @@
73
76
  <%- end -%>
74
77
 
75
78
 
76
- <script src="/register.js"></script>
79
+ <script src="/register.js?<%= Clarion::VERSION %>"></script>
@@ -262,6 +262,7 @@ module Clarion
262
262
  challenge: challenge,
263
263
  origin: request.base_url,
264
264
  credential_id: data[:credential_id],
265
+ extension_results: data[:extension_results] || {},
265
266
  authenticator_data: data[:authenticator_data].unpack('m*')[0],
266
267
  client_data_json: data[:client_data_json].unpack('m*')[0],
267
268
  signature: data[:signature].unpack('m*')[0],
@@ -54,7 +54,7 @@ module Clarion
54
54
  raise Authenticator::InvalidKey
55
55
  end
56
56
 
57
- rp_id = extension_results&.fetch('appid', false) ? legacy_app_id : self.rp_id()
57
+ rp_id = extension_results&.fetch('appid', extension_results&.fetch(:appid, false)) ? legacy_app_id : self.rp_id()
58
58
  allowed_credentials = authn.keys.map { |_| {id: _.handle, public_key: _.public_key_bytes} }
59
59
  unless assertion.valid?(challenge, origin, rp_id: rp_id, allowed_credentials: allowed_credentials)
60
60
  raise Authenticator::InvalidAssertion, "invalid assertion"
@@ -1,3 +1,3 @@
1
1
  module Clarion
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clarion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sorah Fukumori