warden-webauthn 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile.lock +4 -3
- data/README.md +20 -7
- data/lib/warden/webauthn/error_key_finder.rb +2 -0
- data/lib/warden/webauthn/rack_helpers.rb +17 -0
- data/lib/warden/webauthn/strategy_helpers.rb +1 -0
- data/lib/warden/webauthn/version.rb +1 -1
- data/lib/warden/webauthn.rb +1 -0
- data/warden-webauthn.gemspec +42 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0427adf432832eb3cb0782df157e0f76cc7b673f29bbc89f61bca921eadda03
|
4
|
+
data.tar.gz: 6409bbb807abdc11c147e67ddccdd9fdcbd37c3be200ee76fd3e1776d0b5c464
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5205aef3ae71d897d7b013a7e83ea77c09c8e71676eaf89127ff364aaac57fa888a3b18b8c7184a97cb12a087afbdeaf2bfed626ae8ca80c0d324947f5945888
|
7
|
+
data.tar.gz: 1290ec462ed67970bddc391361c4876cd63251041a982723937d74bc47c6c6c6f57c53b2c9e5d475c0139b70f52f7a3155bc00c4bc1865ce19b6d5ac6aa0849d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
warden-webauthn (0.1
|
4
|
+
warden-webauthn (0.2.1)
|
5
5
|
warden
|
6
|
-
webauthn (>= 3
|
6
|
+
webauthn (>= 3)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -36,7 +36,7 @@ GEM
|
|
36
36
|
parallel (1.22.1)
|
37
37
|
parser (3.2.1.0)
|
38
38
|
ast (~> 2.4.1)
|
39
|
-
rack (3.0.
|
39
|
+
rack (3.0.6.1)
|
40
40
|
rack-session (2.0.0)
|
41
41
|
rack (>= 3.0.0)
|
42
42
|
rack-test (2.0.2)
|
@@ -88,6 +88,7 @@ GEM
|
|
88
88
|
PLATFORMS
|
89
89
|
arm64-darwin-21
|
90
90
|
arm64-darwin-22
|
91
|
+
x86_64-linux
|
91
92
|
|
92
93
|
DEPENDENCIES
|
93
94
|
debug
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Warden::WebAuthn
|
2
2
|
|
3
|
-
|
3
|
+
This Warden strategy is a series of helper methods wrapping [webauthn-ruby](https://github.com/cedarcode/webauthn-ruby).
|
4
4
|
|
5
|
-
|
5
|
+
It can be used on its own to allow for webauthn registration/authentication, such as passkeys authentication.
|
6
|
+
|
7
|
+
There is also a lightweight devise extension that uses `Warden::WebAuthn`; if you're using Devise: [devise-passkeys](https://github.com/ruby-passkeys/devise-passkeys)
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -14,15 +16,26 @@ gem 'warden-webauthn'
|
|
14
16
|
|
15
17
|
And then execute:
|
16
18
|
|
17
|
-
|
19
|
+
```sh
|
20
|
+
$ bundle install
|
21
|
+
```
|
18
22
|
|
19
23
|
Or install it yourself as:
|
20
24
|
|
21
|
-
|
25
|
+
```sh
|
26
|
+
$ gem install warden-webauthn
|
27
|
+
```
|
28
|
+
|
22
29
|
|
23
30
|
## Usage
|
24
31
|
|
25
|
-
|
32
|
+
`Warden::WebAuthn` is a series of modules that can be included wherever you need to implement WebAuthn calls. The primary modules/classes are:
|
33
|
+
|
34
|
+
* `Warden::WebAuthn::Strategy`: A subclass of `Warden::Strategies::Base`, the core strategy for WebAuthn authentication in Warden. This is the strategy you'd include in your Warden configuration
|
35
|
+
* `Warden::WebAuthn::StrategyHelpers`: Helpers that can be mixed in to any WebAuthn-related code, such as custom strategies or an app's authentication flow
|
36
|
+
* `Warden::WebAuthn::RegistrationHelpers`: Helper methods to bootstrap registration challenges for implementors
|
37
|
+
* `Warden::WebAuthn::AuthenticationInitiationHelpers`: Helper methods for generating & storing authentication challenges
|
38
|
+
* `Warden::WebAuthn::ErrorKeyFinder.webauthn_error_key(exception:)`: Helper method for generating a symbol based on the WebAuthn::Error
|
26
39
|
|
27
40
|
## Development
|
28
41
|
|
@@ -32,7 +45,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
45
|
|
33
46
|
## Contributing
|
34
47
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
48
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/delete_registration_challenge/warden-webauthn. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/delete_registration_challenge/warden-webauthn/blob/main/CODE_OF_CONDUCT.md).
|
36
49
|
|
37
50
|
## License
|
38
51
|
|
@@ -40,4 +53,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
53
|
|
41
54
|
## Code of Conduct
|
42
55
|
|
43
|
-
Everyone interacting in the Warden::WebAuthn project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
56
|
+
Everyone interacting in the Warden::WebAuthn project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/delete_registration_challenge/warden-webauthn/blob/main/CODE_OF_CONDUCT.md).
|
@@ -16,6 +16,8 @@ module Warden
|
|
16
16
|
:webauthn_attestation_statement_unsupported_algorithm
|
17
17
|
when ::WebAuthn::UserVerifiedVerificationError
|
18
18
|
:webauthn_user_verified_verification_error
|
19
|
+
when ::WebAuthn::OriginVerificationError
|
20
|
+
:webauthn_origin_verification_error
|
19
21
|
when ::WebAuthn::ChallengeVerificationError
|
20
22
|
:webauthn_challenge_verification_error
|
21
23
|
when ::WebAuthn::SignCountVerificationError
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Warden
|
4
|
+
module WebAuthn
|
5
|
+
# Helpers that can be mixed in to any Rack middleware or application, in order
|
6
|
+
# to setup the environment for `Warden::WebAuthn`, such as the Relying Party
|
7
|
+
module RackHelpers
|
8
|
+
def relying_party_key
|
9
|
+
"warden.webauthn.relying_party"
|
10
|
+
end
|
11
|
+
|
12
|
+
def set_relying_party_in_request_env
|
13
|
+
request.env[relying_party_key] = relying_party
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -7,6 +7,7 @@ module Warden
|
|
7
7
|
# Helpers that can be mixed in to any WebAuthn-related code, such as custom strategies or
|
8
8
|
# an app's authentication flow
|
9
9
|
module StrategyHelpers
|
10
|
+
prepend RackHelpers
|
10
11
|
class NoStoredCredentialFound < StandardError; end
|
11
12
|
|
12
13
|
# rubocop:disable Metrics/MethodLength
|
data/lib/warden/webauthn.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "webauthn/version"
|
4
4
|
require_relative "webauthn/error_key_finder"
|
5
|
+
require_relative "webauthn/rack_helpers"
|
5
6
|
require_relative "webauthn/strategy_helpers"
|
6
7
|
require_relative "webauthn/strategy"
|
7
8
|
require_relative "webauthn/authentication_initiation_helpers"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/warden/webauthn/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "warden-webauthn"
|
7
|
+
spec.version = Warden::WebAuthn::VERSION
|
8
|
+
spec.authors = ["Thomas Cannon"]
|
9
|
+
spec.email = ["tcannon00@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "A Warden Strategy for WebAuthn"
|
12
|
+
spec.description = "A Warden Strategy for WebAuthn"
|
13
|
+
spec.homepage = "https://github.com/ruby-passkeys/warden-webauthn"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
16
|
+
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
|
+
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/ruby-passkeys/warden-webauthn"
|
21
|
+
spec.metadata["changelog_uri"] = "https://github.com/ruby-passkeys/warden-webauthn/blob/main/CHANGELOG.md"
|
22
|
+
|
23
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
24
|
+
|
25
|
+
# Specify which files should be added to the gem when it is released.
|
26
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
28
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
29
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
30
|
+
end
|
31
|
+
end
|
32
|
+
spec.bindir = "exe"
|
33
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
34
|
+
spec.require_paths = ["lib"]
|
35
|
+
|
36
|
+
# Uncomment to register a new dependency of your gem
|
37
|
+
spec.add_dependency "warden"
|
38
|
+
spec.add_dependency "webauthn", ">= 3"
|
39
|
+
|
40
|
+
# For more information and examples about making a new gem, check out our
|
41
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden-webauthn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Cannon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: warden
|
@@ -57,15 +57,18 @@ files:
|
|
57
57
|
- lib/warden/webauthn.rb
|
58
58
|
- lib/warden/webauthn/authentication_initiation_helpers.rb
|
59
59
|
- lib/warden/webauthn/error_key_finder.rb
|
60
|
+
- lib/warden/webauthn/rack_helpers.rb
|
60
61
|
- lib/warden/webauthn/registration_helpers.rb
|
61
62
|
- lib/warden/webauthn/strategy.rb
|
62
63
|
- lib/warden/webauthn/strategy_helpers.rb
|
63
64
|
- lib/warden/webauthn/version.rb
|
64
65
|
- sig/warden/webauthn.rbs
|
66
|
+
- warden-webauthn.gemspec
|
65
67
|
homepage: https://github.com/ruby-passkeys/warden-webauthn
|
66
68
|
licenses:
|
67
69
|
- MIT
|
68
70
|
metadata:
|
71
|
+
allowed_push_host: https://rubygems.org
|
69
72
|
homepage_uri: https://github.com/ruby-passkeys/warden-webauthn
|
70
73
|
source_code_uri: https://github.com/ruby-passkeys/warden-webauthn
|
71
74
|
changelog_uri: https://github.com/ruby-passkeys/warden-webauthn/blob/main/CHANGELOG.md
|