webauthn-slim 3.4.3

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.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/actions/install-openssl/action.yml +35 -0
  4. data/.github/actions/install-ruby/action.yml +76 -0
  5. data/.github/dependabot.yml +6 -0
  6. data/.github/workflows/build.yml +49 -0
  7. data/.github/workflows/git.yml +21 -0
  8. data/.github/workflows/release.yml +28 -0
  9. data/.gitignore +16 -0
  10. data/.rspec +2 -0
  11. data/.rubocop.yml +306 -0
  12. data/CHANGELOG.md +462 -0
  13. data/CONTRIBUTING.md +39 -0
  14. data/Gemfile +8 -0
  15. data/LICENSE.txt +21 -0
  16. data/README.md +479 -0
  17. data/Rakefile +10 -0
  18. data/SECURITY.md +21 -0
  19. data/bin/console +15 -0
  20. data/bin/setup +8 -0
  21. data/docs/advanced_configuration.md +173 -0
  22. data/docs/u2f_migration.md +90 -0
  23. data/lib/webauthn/attestation_object.rb +47 -0
  24. data/lib/webauthn/attestation_statement/apple.rb +65 -0
  25. data/lib/webauthn/attestation_statement/base.rb +175 -0
  26. data/lib/webauthn/attestation_statement/fido_u2f/public_key.rb +44 -0
  27. data/lib/webauthn/attestation_statement/fido_u2f.rb +71 -0
  28. data/lib/webauthn/attestation_statement/none.rb +23 -0
  29. data/lib/webauthn/attestation_statement/packed.rb +72 -0
  30. data/lib/webauthn/attestation_statement.rb +35 -0
  31. data/lib/webauthn/authenticator_assertion_response.rb +87 -0
  32. data/lib/webauthn/authenticator_attestation_response.rb +84 -0
  33. data/lib/webauthn/authenticator_data/attested_credential_data.rb +94 -0
  34. data/lib/webauthn/authenticator_data.rb +130 -0
  35. data/lib/webauthn/authenticator_response.rb +137 -0
  36. data/lib/webauthn/cbor.rb +189 -0
  37. data/lib/webauthn/client_data.rb +67 -0
  38. data/lib/webauthn/configuration.rb +68 -0
  39. data/lib/webauthn/cose.rb +237 -0
  40. data/lib/webauthn/credential.rb +26 -0
  41. data/lib/webauthn/credential_creation_options.rb +97 -0
  42. data/lib/webauthn/credential_entity.rb +11 -0
  43. data/lib/webauthn/credential_options.rb +17 -0
  44. data/lib/webauthn/credential_request_options.rb +44 -0
  45. data/lib/webauthn/credential_rp_entity.rb +8 -0
  46. data/lib/webauthn/credential_user_entity.rb +16 -0
  47. data/lib/webauthn/encoder.rb +18 -0
  48. data/lib/webauthn/encoders.rb +62 -0
  49. data/lib/webauthn/error.rb +5 -0
  50. data/lib/webauthn/fake_authenticator/attestation_object.rb +90 -0
  51. data/lib/webauthn/fake_authenticator/authenticator_data.rb +156 -0
  52. data/lib/webauthn/fake_authenticator.rb +134 -0
  53. data/lib/webauthn/fake_client.rb +179 -0
  54. data/lib/webauthn/json_serializer.rb +45 -0
  55. data/lib/webauthn/public_key.rb +65 -0
  56. data/lib/webauthn/public_key_credential/creation_options.rb +93 -0
  57. data/lib/webauthn/public_key_credential/entity.rb +21 -0
  58. data/lib/webauthn/public_key_credential/options.rb +51 -0
  59. data/lib/webauthn/public_key_credential/request_options.rb +46 -0
  60. data/lib/webauthn/public_key_credential/rp_entity.rb +23 -0
  61. data/lib/webauthn/public_key_credential/user_entity.rb +24 -0
  62. data/lib/webauthn/public_key_credential.rb +94 -0
  63. data/lib/webauthn/public_key_credential_with_assertion.rb +49 -0
  64. data/lib/webauthn/public_key_credential_with_attestation.rb +30 -0
  65. data/lib/webauthn/relying_party.rb +150 -0
  66. data/lib/webauthn/u2f_migrator.rb +76 -0
  67. data/lib/webauthn/version.rb +5 -0
  68. data/lib/webauthn.rb +19 -0
  69. data/webauthn.gemspec +43 -0
  70. metadata +218 -0
data/CHANGELOG.md ADDED
@@ -0,0 +1,462 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased](https://github.com/cedarcode/webauthn-ruby/compare/v3.4.3...master/)
4
+
5
+ ### Added
6
+
7
+ - Add support for crossOrigin/topOrigin verification during credential registration and authentication. [#486](https://github.com/cedarcode/webauthn-ruby/pull/486) [@nicolastemciuc]
8
+
9
+ ## [v3.4.3](https://github.com/cedarcode/webauthn-ruby/compare/v3.4.2...v3.4.3/) - 2025-10-23
10
+
11
+ ### Fixed
12
+
13
+ - Fix `RelyingParty#origin` and `WebAuthn.configuration.origin` always returning `nil`. [#484](https://github.com/cedarcode/webauthn-ruby/pull/484) [@santiagorodriguez96]
14
+ - Now they return the allowed origin if allowed origins has only one element.
15
+
16
+ ## [v3.4.2](https://github.com/cedarcode/webauthn-ruby/compare/v3.4.1...v3.4.2/) - 2025-09-22
17
+
18
+ ### Added
19
+
20
+ - Updated `safety_net_attestation` dependency from `~> 0.4.0` to `~> 0.5.0`.
21
+
22
+ ## [v3.4.1](https://github.com/cedarcode/webauthn-ruby/compare/v3.4.0...v3.4.1/) - 2025-06-06
23
+
24
+ - Avoid requiring `base64` as it's not a direct dependency. [#459](https://github.com/cedarcode/webauthn-ruby/pull/459) [@santiagorodriguez96]
25
+
26
+ ## [v3.4.0](https://github.com/cedarcode/webauthn-ruby/compare/v3.3.0...v3.4.0/) - 2025-02-17
27
+
28
+ - Added support for Webauthn.config and RelayingParty to accept multiple allowed_origins. [#431](https://github.com/cedarcode/webauthn-ruby/pull/431) [@obroshnij]
29
+
30
+ ## [v3.3.0](https://github.com/cedarcode/webauthn-ruby/compare/v3.2.2...v3.3.0/) - 2025-02-06
31
+
32
+ ### Added
33
+
34
+ - Updated `tpm-key_attestation` dependency from `~> 0.12.0` to `~> 0.14.0`. [#449](https://github.com/cedarcode/webauthn-ruby/pull/449) [@brauliomartinezlm], [@nicolastemciuc]
35
+
36
+ ## [v3.2.2](https://github.com/cedarcode/webauthn-ruby/compare/v3.2.1...v3.2.2/) - 2024-11-14
37
+
38
+ ### Fixed
39
+
40
+ - Fix `PublicKeyCredential::Options#.as_json` not camelCase'ing keys of attributes with hash or arrays as values. [#445](https://github.com/cedarcode/webauthn-ruby/pull/445) [@santiagorodriguez96]
41
+
42
+ ## [v3.2.1](https://github.com/cedarcode/webauthn-ruby/compare/v3.2.0...v3.2.1/) - 2024-11-14
43
+
44
+ ### Fixed
45
+
46
+ - Fix JSON Serializer generating json with attributes with a null value. [#442](https://github.com/cedarcode/webauthn-ruby/pull/442) [@santiagorodriguez96]
47
+
48
+ ## [v3.2.0](https://github.com/cedarcode/webauthn-ruby/compare/v3.1.0...v3.2.0/) - 2024-11-13
49
+
50
+ ### Added
51
+
52
+ - Added `AuthenticatorAttestationResponse#transports` for accessing the response's `transports` value. [#421](https://github.com/cedarcode/webauthn-ruby/pull/421) [@santiagorodriguez96]
53
+ - `WebAuthn::AuthenticatorAssertionResponse#verify` and `WebAuthn::AuthenticatorAttestationResponse#verify`,
54
+ as well as `RelyingParty#verify_registration` and `RelyingParty#verify_authentication` now accept a `user_presence`
55
+ keyword arg in order to be able to skip the user presence check for specific attestation and assertion verifications.
56
+ By default, user presence will be checked unless `silent_authentication` is enabled for the Relying Party (as it was before).
57
+ [#432](https://github.com/cedarcode/webauthn-ruby/pull/432), [#434](https://github.com/cedarcode/webauthn-ruby/pull/434), [#435](https://github.com/cedarcode/webauthn-ruby/pull/435) ([@nov](https://github.com/nov), [@santiagorodriguez96])
58
+ - `WebAuthn::FakeClient#create` and `WebAuthn::FakeAuthenticator#make_credential` now support a `credential_algorithm` and
59
+ `algorithm` param (respectively) for choosing the algorithm to use for creating the credential.
60
+ Supported values are: 'ES256', 'RSA256' and 'EdDSA'. [#400](https://github.com/cedarcode/webauthn-ruby/pull/400), [#437](https://github.com/cedarcode/webauthn-ruby/pull/437) [@santiagorodriguez96]
61
+ - Remove `awrence` dependency. [#436](https://github.com/cedarcode/webauthn-ruby/pull/436) [@npezza](https://github.com/npezza93)
62
+ - Run tests with Ruby 3.3. [#416](https://github.com/cedarcode/webauthn-ruby/pull/416) [@santiagorodriguez96]
63
+ - Run tests with Ruby 3.4.0-preview2. [#436](https://github.com/cedarcode/webauthn-ruby/pull/436) [@npezza](https://github.com/npezza93)
64
+
65
+ ### Changed
66
+
67
+ - Remove unused class `AttestationTrustworthinessVerificationError`. [#412](https://github.com/cedarcode/webauthn-ruby/pull/412) [@soartec-lab]
68
+
69
+ ## [v3.1.0](https://github.com/cedarcode/webauthn-ruby/compare/v3.0.0...v3.1.0/) - 2023-12-26
70
+
71
+ ### Added
72
+
73
+ - Add support for optional `authenticator_attachment` in `PublicKeyCredential`. [#370](https://github.com/cedarcode/webauthn-ruby/pull/370) [@8ma10s]
74
+
75
+ ### Fixed
76
+
77
+ - Fix circular require warning between `webauthn/relying_party` and `webauthn/credential`. [#389](https://github.com/cedarcode/webauthn-ruby/pull/389) [@bdewater]
78
+ - Correctly verify attestation that contains just a batch certificate that is present in the attestation root certificates. [#406](https://github.com/cedarcode/webauthn-ruby/pull/406) [@santiagorodriguez96]
79
+
80
+ ### Changed
81
+
82
+ - Inlined `base64` implementation. [#402](https://github.com/cedarcode/webauthn-ruby/pull/402) [@olleolleolle]
83
+ - Raise a more descriptive error if input `challenge` is `nil` when verifying the `PublicKeyCredential`. [#413](https://github.com/cedarcode/webauthn-ruby/pull/413) [@soartec-lab]
84
+
85
+ ## [v3.0.0] - 2023-02-15
86
+
87
+ ### Added
88
+
89
+ - Add the capability of handling appid extension [#319](https://github.com/cedarcode/webauthn-ruby/pull/319) [@santiagorodriguez96]
90
+ - Add support for credential backup flags [#378](https://github.com/cedarcode/webauthn-ruby/pull/378) [@santiagorodriguez96]
91
+ - Update dependencies to make gem compatible with OpenSSL 3.1 ([@bdewater],[@santiagorodriguez96])
92
+
93
+ ## [v3.0.0.alpha2](https://github.com/cedarcode/webauthn-ruby/compare/2-stable...v3.0.0.alpha2/) - 2022-09-12
94
+
95
+ ### Added
96
+
97
+ - Rebased support for multiple relying parties from v3.0.0.alpha1 on top of v2.5.2, the previous alpha version was based on v2.3.0 ([@bdewater])
98
+
99
+ ### BREAKING CHANGES
100
+
101
+ - Bumped minimum required Ruby version to 2.5 ([@bdewater])
102
+
103
+ ## [v3.0.0.alpha1](https://github.com/cedarcode/webauthn-ruby/compare/v2.3.0...v3.0.0.alpha1) - 2020-06-27
104
+
105
+ ### Added
106
+
107
+ - Ability to define multiple relying parties with the introduction of the `WebAuthn::RelyingParty` class ([@padulafacundo], [@brauliomartinezlm])
108
+
109
+ ## [v2.5.2](https://github.com/cedarcode/webauthn-ruby/compare/v2.5.1...v2.5.2/) - 2022-07-13
110
+
111
+ ### Added
112
+
113
+ - Updated dependencies to make the gem compatible with openssl-3 [@ClearlyClaire]
114
+
115
+ ## [v2.5.1](https://github.com/cedarcode/webauthn-ruby/compare/v2.5.0...v2.5.1/) - 2022-03-20
116
+
117
+ ### Added
118
+
119
+ - Updated openssl support to be ~>2.2 [@bdewater]
120
+
121
+ ### Removed
122
+
123
+ - Removed dependency [secure_compare dependency](https://rubygems.org/gems/secure_compare/versions/0.0.1) and use OpenSSL#secure_compare instead [@bdewater]
124
+
125
+ ## [v2.5.0](https://github.com/cedarcode/webauthn-ruby/compare/v2.4.1...v2.5.0/) - 2021-03-14
126
+
127
+ ### Added
128
+
129
+ - Support 'apple' attestation statement format ([#343](https://github.com/cedarcode/webauthn-ruby/pull/343) / [@juanarias93], [@santiagorodriguez96])
130
+ - Allow specifying an array of ids as `allow_credentials:` for `FakeClient#get` method ([#335](https://github.com/cedarcode/webauthn-ruby/pull/335) / [@kingjan1999])
131
+
132
+ ### Removed
133
+
134
+ - No longer accept "removed from the WebAuthn spec" options `rp: { icon: }` and `user: { icon: }` for `WebAuthn::Credential.options_for_create` method ([#326](https://github.com/cedarcode/webauthn-ruby/pull/326) / [@santiagorodriguez96])
135
+
136
+ ## [v2.4.1](https://github.com/cedarcode/webauthn-ruby/compare/v2.4.0...v2.4.1/) - 2021-02-15
137
+
138
+ ### Fixed
139
+
140
+ - Fix verification of new credential if no attestation provided and 'None' type is not among configured `acceptable_attestation_types`. I.e. reject it instead of letting it go through.
141
+
142
+ ## [v2.4.0](https://github.com/cedarcode/webauthn-ruby/compare/v2.3.0...v2.4.0/) - 2020-09-03
143
+
144
+ ### Added
145
+
146
+ - Support for ES256K credentials
147
+ - `FakeClient#get` accepts `user_handle:` keyword argument ([@lgarron])
148
+
149
+ ## [v2.3.0](https://github.com/cedarcode/webauthn-ruby/compare/v2.2.1...v2.3.0/) - 2020-06-27
150
+
151
+ ### Added
152
+
153
+ - Ability to access extension outputs with `PublicKeyCredential#client_extension_outputs` and `PublicKeyCredential#authenticator_extension_outputs` ([@santiagorodriguez96])
154
+
155
+ ## [v2.2.1](https://github.com/cedarcode/webauthn-ruby/compare/v2.2.0...v2.2.1/) - 2020-06-06
156
+
157
+ ### Fixed
158
+
159
+ - Fixed compatibility with OpenSSL-C (libssl) v1.0.2 ([@santiagorodriguez96])
160
+
161
+ ## [v2.2.0](https://github.com/cedarcode/webauthn-ruby/compare/v2.1.0...v2.2.0/) - 2020-03-14
162
+
163
+ ### Added
164
+
165
+ - Verification step that checks the received credential public key algorithm during registration matches one of the configured algorithms
166
+ - [EXPERIMENTAL] Attestation trustworthiness verification default steps for "tpm", "android-key" and "android-safetynet" ([@bdewater], [@padulafacundo]). Still manual configuration needed for "packed" and "fido-u2f".
167
+
168
+ Note: Expect possible breaking changes for "EXPERIMENTAL" features.
169
+
170
+ ## [v2.1.0](https://github.com/cedarcode/webauthn-ruby/compare/v2.0.0...v2.1.0/) - 2019-12-30
171
+
172
+ ### Added
173
+
174
+ - Ability to convert stored credential public key back to a ruby object with `WebAuthn::PublicKey.deserialize(stored_public_key)`, included the validation during de-serialization ([@ssuttner], [@padulafacundo])
175
+ - Improved TPM attestation validation by checking "Subject Alternative Name" ([@bdewater])
176
+ - Improved SafetyNet attestation validation by checking timestamp ([@padulafacundo])
177
+ - [EXPERIMENTAL] Ability to optionally "Assess the attestation trustworthiness" during registration by setting `acceptable_attestation_types` and `attestation_root_certificates_finders` configuration values ([@padulafacundo])
178
+ - Ruby 2.7 support without warnings
179
+
180
+ Note: Expect possible breaking changes for "EXPERIMENTAL" features.
181
+
182
+ ## [v2.0.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.18.0...v2.0.0/) - 2019-10-03
183
+
184
+ ### Added
185
+
186
+ - Smarter new public API methods:
187
+ - `WebAuthn.generate_user_id`
188
+ - `WebAuthn::Credential.options_for_create`
189
+ - `WebAuthn::Credential.options_for_get`
190
+ - `WebAuthn::Credential.from_create`
191
+ - `WebAuthn::Credential.from_get`
192
+ - All the above automatically handle encoding/decoding for necessary values. The specific encoding scheme can
193
+ be set (or even turned off) in `WebAutnn.configuration.encoding=`. Defaults to `:base64url`.
194
+ - `WebAuthn::FakeClient#get` better fakes a real client by including `userHandle` in the returned hash.
195
+ - Expose AAGUID and attestationCertificateKey for MDS lookup during attestation ([@bdewater])
196
+
197
+ ### Changed
198
+
199
+ - `WebAuthn::AuthenticatorAssertionResponse#verify` no longer accepts `allowed_credentials:` keyword argument.
200
+ Please replace with `public_key:` and `sign_count:` keyword arguments. If you're not performing sign count
201
+ verification, signal opt-out with `sign_count: false`.
202
+
203
+ - `WebAuthn::FakeClient#create` and `WebAuthn::FakeClient#get` better fakes a real client by using lowerCamelCase
204
+ string keys instead of snake_case symbol keys in the returned hash.
205
+
206
+ - `WebAuthn::FakeClient#create` and `WebAuthn::FakeClient#get` better fakes a real client by not padding the
207
+ returned base64url-encoded `id` value.
208
+
209
+ ### Deprecated
210
+
211
+ - `WebAuthn.credential_creation_options` method. Please consider using `WebAuthn::Credential.options_for_create`.
212
+ - `WebAuthn.credential_request_options` method. Please consider using `WebAuthn::Credential.options_for_get`.
213
+
214
+ ### Removed
215
+
216
+ - `WebAuthn::AuthenticatorAssertionResponse.new` no longer accepts `credential_id`. No replacement needed, just don't
217
+ pass it.
218
+
219
+ ### BREAKING CHANGES
220
+
221
+ - `WebAuthn::AuthenticatorAssertionResponse.new` no longer accepts `credential_id`. No replacement needed, just don't
222
+ pass it.
223
+
224
+ - `WebAuthn::AuthenticatorAssertionResponse#verify` no longer accepts `allowed_credentials:` keyword argument.
225
+ Please replace with `public_key:` and `sign_count:` keyword arguments. If you're not performing sign count
226
+ verification, signal opt-out with `sign_count: false`.
227
+
228
+ - `WebAuthn::FakeClient#create` and `WebAuthn::FakeClient#get` better fakes a real client by using lowerCamelCase
229
+ string keys instead of snake_case symbol keys in the returned hash.
230
+
231
+ - `WebAuthn::FakeClient#create` and `WebAuthn::FakeClient#get` better fakes a real client by not padding the
232
+ returned base64url-encoded `id` value.
233
+
234
+ ## [v1.18.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.17.0...v1.18.0/) - 2019-07-27
235
+
236
+ ### Added
237
+
238
+ - Ability to migrate U2F credentials to WebAuthn ([#211](https://github.com/cedarcode/webauthn-ruby/pull/211)) ([@bdewater] + [@jdongelmans])
239
+ - Ability to skip attestation statement verification ([#219](https://github.com/cedarcode/webauthn-ruby/pull/219)) ([@MaximeNdutiye])
240
+ - Ability to configure default credential options timeout ([#243](https://github.com/cedarcode/webauthn-ruby/pull/243)) ([@MaximeNdutiye])
241
+ - AttestedCredentialData presence verification ([#237](https://github.com/cedarcode/webauthn-ruby/pull/237))
242
+ - FakeClient learns how to increment sign count ([#225](https://github.com/cedarcode/webauthn-ruby/pull/225))
243
+
244
+ ### Fixed
245
+
246
+ - Properly verify SafetyNet certificates from input ([#233](https://github.com/cedarcode/webauthn-ruby/pull/233)) ([@bdewater])
247
+ - FakeClient default origin URL ([#242](https://github.com/cedarcode/webauthn-ruby/pull/242)) ([@kalebtesfay])
248
+
249
+ ## [v1.17.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.16.0...v1.17.0/) - 2019-06-18
250
+
251
+ ### Added
252
+
253
+ - Support ES384, ES512, PS384, PS512, RS384 and RS512 credentials. Off by default. Enable by adding any of them to `WebAuthn.configuration.algorithms` array ([@bdewater])
254
+ - Support [Signature Counter](https://www.w3.org/TR/webauthn/#signature-counter) verification ([@bdewater])
255
+
256
+ ## [v1.16.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.15.0...v1.16.0/) - 2019-06-13
257
+
258
+ ### Added
259
+
260
+ - Ability to enforce [user verification](https://www.w3.org/TR/webauthn/#user-verification) with extra argument in the `#verify` method.
261
+ - Support RS1 (RSA w/ SHA-1) credentials. Off by default. Enable by adding `"RS1"` to `WebAuthn.configuration.algorithms` array.
262
+ - Support PS256 (RSA Probabilistic Signature Scheme w/ SHA-256) credentials. On by default ([@bdewater])
263
+
264
+ ## [v1.15.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.14.0...v1.15.0/) - 2019-05-16
265
+
266
+ ### Added
267
+
268
+ - Ability to configure Origin, RP ID and RP Name via `WebAuthn.configure`
269
+
270
+ ## [v1.14.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.13.0...v1.14.0/) - 2019-04-25
271
+
272
+ ### Added
273
+
274
+ - Support 'tpm' attestation statement
275
+ - Support RS256 credential public key
276
+
277
+ ## [v1.13.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.12.0...v1.13.0/) - 2019-04-09
278
+
279
+ ### Added
280
+
281
+ - Verify 'none' attestation statement is really empty.
282
+ - Verify 'packed' attestation statement certificates start/end dates.
283
+ - Verify 'packed' attestation statement signature algorithm.
284
+ - Verify 'fiod-u2f attestation statement AAGUID is zeroed out ([@bdewater])
285
+ - Verify 'android-key' attestation statement signature algorithm.
286
+ - Verify assertion response signature algorithm.
287
+ - Verify collectedClientData.tokenBinding format.
288
+ - `WebAuthn.credential_creation_options` now accept `rp_name`, `user_id`, `user_name` and `display_name` as keyword arguments ([@bdewater])
289
+
290
+ ## [v1.12.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.11.0...v1.12.0/) - 2019-04-03
291
+
292
+ ### Added
293
+
294
+ - Verification of the attestation certificate public key curve for `fido-u2f` attestation statements.
295
+
296
+ ### Changed
297
+
298
+ - `Credential#public_key` now returns the COSE_Key formatted version of the credential public key, instead of the
299
+ uncompressed EC point format.
300
+
301
+ Note #1: A `Credential` instance is what is returned in `WebAuthn::AuthenticatorAttestationResponse#credential`.
302
+
303
+ Note #2: You don't need to do any convesion before passing the public key in `AuthenticatorAssertionResponse#verify`'s
304
+ `allowed_credentials` argument, `#verify` is backwards-compatible and will handle both public key formats properly.
305
+
306
+ ## [v1.11.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.10.0...v1.11.0/) - 2019-03-15
307
+
308
+ ### Added
309
+
310
+ - `WebAuthn::AuthenticatorAttestationResponse#verify` supports `android-key` attestation statements ([@bdewater])
311
+
312
+ ### Fixed
313
+
314
+ - Verify matching AAGUID if needed when verifying `packed` attestation statements ([@bdewater])
315
+
316
+ ## [v1.10.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.9.0...v1.10.0/) - 2019-03-05
317
+
318
+ ### Added
319
+
320
+ - Parse and make AuthenticatorData's extensionData available
321
+
322
+ ## [v1.9.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.8.0...v1.9.0/) - 2019-02-22
323
+
324
+ ### Added
325
+
326
+ - Added `#verify`, which can be used for getting a meaningful error raised in case of a verification error, as opposed to `#valid?` which returns `false`
327
+
328
+ ## [v1.8.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.7.0...v1.8.0/) - 2019-01-17
329
+
330
+ ### Added
331
+
332
+ - Make challenge validation inside `#valid?` method resistant to timing attacks (@tomek-bt)
333
+ - Support for ruby 2.6
334
+
335
+ ### Changed
336
+
337
+ - Make current raised exception errors a bit more meaningful to aid debugging
338
+
339
+ ## [v1.7.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.6.0...v1.7.0/) - 2018-11-08
340
+
341
+ ### Added
342
+
343
+ - _Registration_ ceremony
344
+ - `WebAuthn::AuthenticatorAttestationResponse` exposes attestation type and trust path via `#attestation_type` and `#attestation_trust_path` methods ([@bdewater])
345
+
346
+ ## [v1.6.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.5.0...v1.6.0/) - 2018-11-01
347
+
348
+ ### Added
349
+
350
+ - `FakeAuthenticator` object is now exposed to help you test your WebAuthn implementation
351
+
352
+ ## [v1.5.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.4.0...v1.5.0/) - 2018-10-23
353
+
354
+ ### Added
355
+
356
+ - Works with ruby 2.3 ([@bdewater])
357
+
358
+ ## [v1.4.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.3.0...v1.4.0/) - 2018-10-11
359
+
360
+ ### Added
361
+
362
+ - _Registration_ ceremony
363
+ - `WebAuthn::AuthenticatorAttestationResponse.valid?` supports `android-safetynet` attestation statements ([@bdewater])
364
+
365
+ ## [v1.3.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.2.0...v1.3.0/) - 2018-10-11
366
+
367
+ ### Added
368
+
369
+ - _Registration_ ceremony
370
+ - `WebAuthn::AuthenticatorAttestationResponse.valid?` supports `packed` attestation statements ([@sorah])
371
+
372
+ ## [v1.2.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.1.0...v1.2.0/) - 2018-10-08
373
+
374
+ ### Added
375
+
376
+ - _Registration_ ceremony
377
+ - `WebAuthn::AuthenticatorAttestationResponse.valid?` returns `true` if either UP or UV authenticator flags are present.
378
+ - _Authentication_ ceremony
379
+ - `WebAuthn::AuthenticatorAssertionResponse.valid?` returns `true` if either UP or UV authenticator flags are present.
380
+
381
+ Note: Both additions should help making it compatible with Chrome for Android 70+/Android Fingerprint pair.
382
+
383
+ ## [v1.1.0](https://github.com/cedarcode/webauthn-ruby/compare/v1.0.0...v1.1.0/) - 2018-10-04
384
+
385
+ ### Added
386
+
387
+ - _Registration_ ceremony
388
+ - `WebAuthn::AuthenticatorAttestationResponse.valid?` optionally accepts rp_id ([@sorah])
389
+ - _Authentication_ ceremony
390
+ - `WebAuthn::AuthenticatorAssertionResponse.valid?` optionally accepts rp_id.
391
+
392
+ ## [v1.0.0](https://github.com/cedarcode/webauthn-ruby/compare/v0.2.0...v1.0.0/) - 2018-09-07
393
+
394
+ ### Added
395
+
396
+ - _Authentication_ ceremony
397
+ - Support multiple credentials per user by letting `WebAuthn::AuthenticatorAssertionResponse.valid?` receive multiple allowed credentials
398
+
399
+ ### Changed
400
+
401
+ - _Registration_ ceremony
402
+ - Use 32-byte challenge instead of 16-byte
403
+ - _Authentication_ ceremony
404
+ - Use 32-byte challenge instead of 16-byte
405
+
406
+ ## [v0.2.0](https://github.com/cedarcode/webauthn-ruby/compare/v0.1.0...v0.2.0/) - 2018-06-08
407
+
408
+ ### Added
409
+
410
+ - _Registration_ ceremony
411
+ - `WebAuthn::AuthenticatorAttestationResponse.credential` returns the Credential Public Key for you to store it somehwere for future authentications
412
+ - _Authentication_ ceremony
413
+ - `WebAuthn.credential_request_options` returns default options for you to initiate the _Authentication_
414
+ - `WebAuthn::AuthenticatorAssertionResponse.valid?` can be used to validate the authenticator assertion. For now it validates:
415
+ - Signature
416
+ - Challenge
417
+ - Origin
418
+ - User presence
419
+ - Ceremony Type
420
+ - Relying-Party ID
421
+ - Allowed Credential
422
+ - Works with ruby 2.4
423
+
424
+ ### Changed
425
+
426
+ - _Registration_ ceremony
427
+ - `WebAuthn::AuthenticatorAttestationResponse.valid?` now runs additional validations on the Credential Public Key
428
+
429
+ ### Removed
430
+
431
+ - _Registration_ ceremony
432
+ - `WebAuthn::AuthenticatorAttestationResponse.credential_id` (superseded by `WebAuthn::AuthenticatorAttestationResponse.credential`)
433
+
434
+ ## [v0.1.0](https://github.com/cedarcode/webauthn-ruby/compare/v0.0.0...v0.1.0/) - 2018-05-25
435
+
436
+ ### Added
437
+
438
+ - _Registration_ ceremony:
439
+ - `WebAuthn.credential_creation_options` returns default options for you to initiate the _Registration_
440
+ - `WebAuthn::AuthenticatorAttestationResponse.valid?` can be used to validate fido-u2f attestations returned by the browser
441
+ - Works with ruby 2.5
442
+
443
+ [@bdewater]: https://github.com/bdewater
444
+ [@brauliomartinezlm]: https://github.com/brauliomartinezlm
445
+ [@ClearlyClaire]: https://github.com/ClearlyClaire
446
+ [@jdongelmans]: https://github.com/jdongelmans
447
+ [@jdongelmans]: https://github.com/jdongelmans
448
+ [@juanarias93]: https://github.com/juanarias93
449
+ [@kalebtesfay]: https://github.com/kalebtesfay
450
+ [@kingjan1999]: https://github.com/@kingjan1999
451
+ [@lgarron]: https://github.com/lgarron
452
+ [@MaximeNdutiye]: https://github.com/MaximeNdutiye
453
+ [@nicolastemciuc]: https://github.com/nicolastemciuc
454
+ [@obroshnij]: https://github.com/obroshnij
455
+ [@olleolleolle]: https://github.com/olleolleolle
456
+ [@padulafacundo]: https://github.com/padulafacundo
457
+ [@petergoldstein]: https://github.com/petergoldstein
458
+ [@santiagorodriguez96]: https://github.com/santiagorodriguez96
459
+ [@soartec-lab]: https://github.com/soartec-lab
460
+ [@sorah]: https://github.com/sorah
461
+ [@ssuttner]: https://github.com/ssuttner
462
+ [@8ma10s]: https://github.com/8ma10s
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,39 @@
1
+ ## Contributing to webauthn-ruby
2
+
3
+ ### How?
4
+
5
+ - Creating a new issue to report a bug
6
+ - Creating a new issue to suggest a new feature
7
+ - Commenting on an existing issue to answer an open question
8
+ - Commenting on an existing issue to ask the reporter for more details to aid reproducing the problem
9
+ - Improving documentation
10
+ - Creating a pull request that fixes an issue (see [beginner friendly issues](https://github.com/cedarcode/webauthn-ruby/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22))
11
+ - Creating a pull request that implements a new feature (worth first creating an issue to discuss the suggested feature)
12
+
13
+ ### Development
14
+
15
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to run the tests and code-style checks. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
16
+
17
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
18
+
19
+ ### Styleguide
20
+
21
+ #### Ruby
22
+
23
+ We use [rubocop](https://rubygems.org/gems/rubocop) to check ruby code style.
24
+
25
+ #### Git commit messages
26
+
27
+ We try to follow [Conventional Commits](https://conventionalcommits.org) specification since `v1.17.0`.
28
+
29
+ On top of `fix` and `feat` types, we also use optional:
30
+
31
+ * __build__: Changes that affect the build system or external dependencies
32
+ * __ci__: Changes to the CI configuration files and scripts
33
+ * __docs__: Documentation only changes
34
+ * __perf__: A code change that improves performance
35
+ * __refactor__: A code change that neither fixes a bug nor adds a feature
36
+ * __style__: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
37
+ * __test__: Adding missing tests or correcting existing tests
38
+
39
+ Partially inspired in [Angular's Commit Message Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines).
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in webauthn.gemspec
8
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Gonzalo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.