warden_openid_auth 0.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 +7 -0
- data/.rspec +4 -0
- data/.rubocop.yml +19 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +102 -0
- data/LICENSE.txt +21 -0
- data/README.md +3 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/warden_openid_auth/errors.rb +7 -0
- data/lib/warden_openid_auth/jwks.rb +54 -0
- data/lib/warden_openid_auth/openid_metadata.rb +83 -0
- data/lib/warden_openid_auth/strategy.rb +120 -0
- data/lib/warden_openid_auth/version.rb +5 -0
- data/lib/warden_openid_auth.rb +23 -0
- data/warden_openid_auth.gemspec +42 -0
- metadata +146 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5a6ea5d95308956940c72916462ecc19bc1ffee2fdb7706da433b260cfb81f20
|
4
|
+
data.tar.gz: 56618d37eba3a34a73a77484cc25a2ef1d6573c75afa6536aa587cef17a28698
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b1523543a26b8ecaad1ff9669b4e178533f293941467bcdb37b5aa18f7e2579f3f8a2425b038d742c1ec70c17cc2fa338dd6a8d85003d95b56d4909fc5163f6a
|
7
|
+
data.tar.gz: 3474b67601d4a9a9415657f171e5b36b1d96dc4de4f522e2fcd2fa6f10d652b6a8675ea172a0371ad43df2444a8d167a598e105130ba97d87f4057943a518d32
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-rake
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
NewCops: enable
|
7
|
+
|
8
|
+
Metrics/BlockLength:
|
9
|
+
Exclude:
|
10
|
+
- 'spec/**/*'
|
11
|
+
|
12
|
+
RSpec/VerifiedDoubles:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Bundler/OrderedGems:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Gemspec/OrderedDependencies:
|
19
|
+
Enabled: false
|
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in warden_openid_auth.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem 'rake', '~> 13.0'
|
9
|
+
gem 'rspec', '~> 3.11'
|
10
|
+
gem 'rubocop', '~> 1.25', require: false
|
11
|
+
gem 'rubocop-rspec', '~> 2.9', require: false
|
12
|
+
gem 'rubocop-rake', '~> 0.6', require: false
|
13
|
+
gem 'webmock', '~> 3.14'
|
14
|
+
gem 'rack-test', '~> 1.1'
|
15
|
+
gem 'byebug', '~> 11.1'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
warden_openid_auth (0.1.0)
|
5
|
+
dry-configurable (~> 0.14)
|
6
|
+
dry-monads (~> 1.4)
|
7
|
+
faraday (~> 2.2)
|
8
|
+
faraday-retry (~> 1.0)
|
9
|
+
jwt (~> 2.3)
|
10
|
+
warden (~> 1.2)
|
11
|
+
|
12
|
+
GEM
|
13
|
+
remote: https://rubygems.org/
|
14
|
+
specs:
|
15
|
+
addressable (2.8.0)
|
16
|
+
public_suffix (>= 2.0.2, < 5.0)
|
17
|
+
ast (2.4.2)
|
18
|
+
byebug (11.1.3)
|
19
|
+
concurrent-ruby (1.1.9)
|
20
|
+
crack (0.4.5)
|
21
|
+
rexml
|
22
|
+
diff-lcs (1.5.0)
|
23
|
+
dry-configurable (0.14.0)
|
24
|
+
concurrent-ruby (~> 1.0)
|
25
|
+
dry-core (~> 0.6)
|
26
|
+
dry-core (0.7.1)
|
27
|
+
concurrent-ruby (~> 1.0)
|
28
|
+
dry-monads (1.4.0)
|
29
|
+
concurrent-ruby (~> 1.0)
|
30
|
+
dry-core (~> 0.7)
|
31
|
+
faraday (2.2.0)
|
32
|
+
faraday-net_http (~> 2.0)
|
33
|
+
ruby2_keywords (>= 0.0.4)
|
34
|
+
faraday-net_http (2.0.1)
|
35
|
+
faraday-retry (1.0.3)
|
36
|
+
hashdiff (1.0.1)
|
37
|
+
jwt (2.3.0)
|
38
|
+
parallel (1.21.0)
|
39
|
+
parser (3.1.1.0)
|
40
|
+
ast (~> 2.4.1)
|
41
|
+
public_suffix (4.0.6)
|
42
|
+
rack (2.2.3)
|
43
|
+
rack-test (1.1.0)
|
44
|
+
rack (>= 1.0, < 3)
|
45
|
+
rainbow (3.1.1)
|
46
|
+
rake (13.0.6)
|
47
|
+
regexp_parser (2.2.1)
|
48
|
+
rexml (3.2.5)
|
49
|
+
rspec (3.11.0)
|
50
|
+
rspec-core (~> 3.11.0)
|
51
|
+
rspec-expectations (~> 3.11.0)
|
52
|
+
rspec-mocks (~> 3.11.0)
|
53
|
+
rspec-core (3.11.0)
|
54
|
+
rspec-support (~> 3.11.0)
|
55
|
+
rspec-expectations (3.11.0)
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
+
rspec-support (~> 3.11.0)
|
58
|
+
rspec-mocks (3.11.0)
|
59
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
+
rspec-support (~> 3.11.0)
|
61
|
+
rspec-support (3.11.0)
|
62
|
+
rubocop (1.25.1)
|
63
|
+
parallel (~> 1.10)
|
64
|
+
parser (>= 3.1.0.0)
|
65
|
+
rainbow (>= 2.2.2, < 4.0)
|
66
|
+
regexp_parser (>= 1.8, < 3.0)
|
67
|
+
rexml
|
68
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
69
|
+
ruby-progressbar (~> 1.7)
|
70
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
71
|
+
rubocop-ast (1.16.0)
|
72
|
+
parser (>= 3.1.1.0)
|
73
|
+
rubocop-rake (0.6.0)
|
74
|
+
rubocop (~> 1.0)
|
75
|
+
rubocop-rspec (2.9.0)
|
76
|
+
rubocop (~> 1.19)
|
77
|
+
ruby-progressbar (1.11.0)
|
78
|
+
ruby2_keywords (0.0.5)
|
79
|
+
unicode-display_width (2.1.0)
|
80
|
+
warden (1.2.9)
|
81
|
+
rack (>= 2.0.9)
|
82
|
+
webmock (3.14.0)
|
83
|
+
addressable (>= 2.8.0)
|
84
|
+
crack (>= 0.3.2)
|
85
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
86
|
+
|
87
|
+
PLATFORMS
|
88
|
+
x86_64-linux
|
89
|
+
|
90
|
+
DEPENDENCIES
|
91
|
+
byebug (~> 11.1)
|
92
|
+
rack-test (~> 1.1)
|
93
|
+
rake (~> 13.0)
|
94
|
+
rspec (~> 3.11)
|
95
|
+
rubocop (~> 1.25)
|
96
|
+
rubocop-rake (~> 0.6)
|
97
|
+
rubocop-rspec (~> 2.9)
|
98
|
+
warden_openid_auth!
|
99
|
+
webmock (~> 3.14)
|
100
|
+
|
101
|
+
BUNDLED WITH
|
102
|
+
2.2.32
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 Blayne Farinha
|
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.
|
data/README.md
ADDED
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'warden_openid_auth'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'digest'
|
4
|
+
|
5
|
+
module WardenOpenidAuth
|
6
|
+
# Represents a JSON Web Key Set. It will cache the results of the web request to get the JWKS so
|
7
|
+
# that it does not need to make an external request for the JWKS to authenticate every user.
|
8
|
+
class JWKS
|
9
|
+
attr_reader :jwks_url, :cache, :cache_options
|
10
|
+
|
11
|
+
# @param jwks_url [String] the URL that the JSON Web Key Set can be retrieved from.
|
12
|
+
# @param config [#cache, #cache_options] the object that holds the cache and cache options.
|
13
|
+
def initialize(jwks_url:, config: WardenOpenidAuth.config)
|
14
|
+
@jwks_url = jwks_url
|
15
|
+
@cache = config.cache
|
16
|
+
@cache_options = config.cache_options
|
17
|
+
end
|
18
|
+
|
19
|
+
# Checks the cache to see if it contains the JSON Web Key Set and returns it. If it is not in
|
20
|
+
# the cache it will fetch it from the URL specified.
|
21
|
+
#
|
22
|
+
# @return [Hash] a Hash representation of the JSON Web Key Set.
|
23
|
+
def key_set
|
24
|
+
result = cache.read(cache_key)
|
25
|
+
return result unless result.nil?
|
26
|
+
|
27
|
+
fetch_and_store_jwks
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def cache_key
|
33
|
+
@cache_key ||= "jwks_#{Digest::MD5.hexdigest(jwks_url)}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def fetch_and_store_jwks
|
37
|
+
result = client.get(jwks_url)
|
38
|
+
|
39
|
+
raise JWKSFetchError, "Received #{result.status} from server." unless result.success?
|
40
|
+
|
41
|
+
cache.write(cache_key, result.body, cache_options)
|
42
|
+
result.body
|
43
|
+
rescue Faraday::Error => e
|
44
|
+
raise JWKSFetchError, "Faraday encountered a #{e.class} error. The message returned was \"#{e.message}\""
|
45
|
+
end
|
46
|
+
|
47
|
+
def client
|
48
|
+
Faraday.new(nil, request: { timeout: 5 }) do |f|
|
49
|
+
f.request :retry
|
50
|
+
f.response :json, parser_options: { symbolize_names: true }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'faraday'
|
4
|
+
require 'faraday/retry'
|
5
|
+
require 'uri'
|
6
|
+
require 'erb'
|
7
|
+
|
8
|
+
module WardenOpenidAuth
|
9
|
+
# Representation of the OpenID config document.
|
10
|
+
class OpenidMetadata
|
11
|
+
include ERB::Util
|
12
|
+
|
13
|
+
attr_reader :metadata_url, :cache, :cache_options, :client_id
|
14
|
+
|
15
|
+
# @param config [#openid_metadata_url, #cache, #cache_options] object containg the desired configuration.
|
16
|
+
def initialize(config: WardenOpenidAuth.config)
|
17
|
+
@metadata_url = config.openid_metadata_url
|
18
|
+
@cache = config.cache
|
19
|
+
@cache_options = config.cache_options
|
20
|
+
@client_id = config.client_id
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [String] the endpoint for authorization
|
24
|
+
def authorization_endpoint
|
25
|
+
config_document['authorization_endpoint']
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [String] the full URL for authorization including parameters
|
29
|
+
def authorization_url(redirect_uri:, state:, scope: 'openid profile email')
|
30
|
+
uri = URI(authorization_endpoint)
|
31
|
+
uri.query = "client_id=#{url_encode(client_id)}&redirect_uri=#{url_encode(redirect_uri)}" \
|
32
|
+
"&scope=#{url_encode(scope)}&state=#{url_encode(state)}&response_mode=query&response_type=code"
|
33
|
+
uri.to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
# @return [String] the endpoint to hit to get tokens.
|
37
|
+
def token_endpoint
|
38
|
+
config_document['token_endpoint']
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [String] the endpoint to hit to get the JSON Web Key Set.
|
42
|
+
def jwks_uri
|
43
|
+
config_document['jwks_uri']
|
44
|
+
end
|
45
|
+
|
46
|
+
# @return [String] the issuer according to the metadata document.
|
47
|
+
def issuer
|
48
|
+
config_document['issuer']
|
49
|
+
end
|
50
|
+
|
51
|
+
# @return [Hash] a hash representation of the OpenID configuration document.
|
52
|
+
def to_h
|
53
|
+
config_document
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def config_document
|
59
|
+
config = cache.read('openid_metadata')
|
60
|
+
return config unless config.nil?
|
61
|
+
|
62
|
+
fetch_and_store_config
|
63
|
+
end
|
64
|
+
|
65
|
+
def fetch_and_store_config
|
66
|
+
result = client.get(metadata_url)
|
67
|
+
|
68
|
+
raise OpenidConfigFetchError, "Received #{result.status} from server." unless result.success?
|
69
|
+
|
70
|
+
cache.write('openid_metadata', result.body, cache_options)
|
71
|
+
result.body
|
72
|
+
rescue Faraday::Error => e
|
73
|
+
raise OpenidConfigFetchError, "Faraday encountered a #{e.class} error. The message returned was \"#{e.message}\""
|
74
|
+
end
|
75
|
+
|
76
|
+
def client
|
77
|
+
Faraday.new(nil, request: { timeout: 5 }) do |f|
|
78
|
+
f.request :retry
|
79
|
+
f.response :json
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'dry-monads'
|
4
|
+
require 'dry/monads/do'
|
5
|
+
require 'faraday'
|
6
|
+
require 'faraday/retry'
|
7
|
+
require 'jwt'
|
8
|
+
require 'warden'
|
9
|
+
|
10
|
+
module WardenOpenidAuth
|
11
|
+
# This strategy uses OpenID to log the user in. This should be called as the callback phase of an
|
12
|
+
# OpenID auth code flow strategy. It will exchange the auth_code provided for an ID token and validate the ID Token.
|
13
|
+
class Strategy < Warden::Strategies::Base
|
14
|
+
include Dry::Monads[:result]
|
15
|
+
include Dry::Monads::Do.for(:validate_user)
|
16
|
+
|
17
|
+
# Only run strategy if this evaluates to true.
|
18
|
+
def valid?
|
19
|
+
params.key?('code') || params.key?('error')
|
20
|
+
end
|
21
|
+
|
22
|
+
# Authenticate and log the user in.
|
23
|
+
def authenticate!
|
24
|
+
if params.key?('error')
|
25
|
+
fail!("There was a problem loging you in. #{params['error_description']}")
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
29
|
+
case validate_user
|
30
|
+
in Success(user)
|
31
|
+
success!(user)
|
32
|
+
in Failure(message:)
|
33
|
+
fail!(message)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def validate_user
|
40
|
+
token = yield fetch_token
|
41
|
+
claims = yield validate_token(token)
|
42
|
+
user = yield fetch_user(claims)
|
43
|
+
|
44
|
+
Success(user)
|
45
|
+
rescue WardenOpenidAuth::OpenidConfigFetchError
|
46
|
+
Failure(message: 'Could not fetch OpenID Configuration Document')
|
47
|
+
rescue WardenOpenidAuth::JWKSFetchError
|
48
|
+
Failure(message: 'Could not fetch JSON Web Key Set to verify token.')
|
49
|
+
end
|
50
|
+
|
51
|
+
def fetch_token
|
52
|
+
result = client.post(openid_metadata.token_endpoint, fetch_token_post_params)
|
53
|
+
return Failure(message: 'Unable to exchange authorization code for a token.') unless result.success?
|
54
|
+
|
55
|
+
Success(result.body['id_token'])
|
56
|
+
rescue Faraday::Error
|
57
|
+
Failure(message: 'Unable to exchange authorization code for a token.')
|
58
|
+
end
|
59
|
+
|
60
|
+
def validate_token(token)
|
61
|
+
Success(JWT.decode(token, nil, true, decode_opts).first)
|
62
|
+
rescue JWT::DecodeError
|
63
|
+
Failure(message: 'There was an error with the id token recieved. Please try again.')
|
64
|
+
end
|
65
|
+
|
66
|
+
def fetch_user(claims)
|
67
|
+
result = config.user_finder.call(claims)
|
68
|
+
return result if result.is_a?(Dry::Monads::Result)
|
69
|
+
return Failure(message: 'Could not find user.') if result.nil?
|
70
|
+
|
71
|
+
Success(result)
|
72
|
+
end
|
73
|
+
|
74
|
+
def fetch_token_post_params
|
75
|
+
{
|
76
|
+
client_id: config.client_id,
|
77
|
+
code: params['code'],
|
78
|
+
redirect_uri: "#{request.base_url}#{request.path}",
|
79
|
+
grant_type: 'authorization_code',
|
80
|
+
client_secret: config.client_secret
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# rubocop:disable Metrics/MethodLength
|
85
|
+
def decode_opts
|
86
|
+
{
|
87
|
+
algorithm: 'RS256',
|
88
|
+
verify_expiration: true,
|
89
|
+
verify_not_before: true,
|
90
|
+
verify_iat: true,
|
91
|
+
verify_iss: true,
|
92
|
+
iss: openid_metadata.issuer,
|
93
|
+
verify_aud: true,
|
94
|
+
aud: config.client_id,
|
95
|
+
jwks: jwks.key_set
|
96
|
+
}
|
97
|
+
end
|
98
|
+
# rubocop:enable Metrics/MethodLength
|
99
|
+
|
100
|
+
def client
|
101
|
+
Faraday.new(nil, request: { timeout: 5 }) do |f|
|
102
|
+
f.request :url_encoded
|
103
|
+
f.request :retry
|
104
|
+
f.response :json
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def config
|
109
|
+
WardenOpenidAuth.config
|
110
|
+
end
|
111
|
+
|
112
|
+
def openid_metadata
|
113
|
+
@openid_metadata ||= WardenOpenidAuth::OpenidMetadata.new(config: config)
|
114
|
+
end
|
115
|
+
|
116
|
+
def jwks
|
117
|
+
WardenOpenidAuth::JWKS.new(jwks_url: openid_metadata.jwks_uri, config: config)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uri'
|
4
|
+
require 'dry-configurable'
|
5
|
+
|
6
|
+
require 'warden_openid_auth/version'
|
7
|
+
require 'warden_openid_auth/openid_metadata'
|
8
|
+
require 'warden_openid_auth/jwks'
|
9
|
+
require 'warden_openid_auth/strategy'
|
10
|
+
require 'warden_openid_auth/errors'
|
11
|
+
|
12
|
+
module WardenOpenidAuth
|
13
|
+
extend Dry::Configurable
|
14
|
+
|
15
|
+
setting :client_id
|
16
|
+
setting :client_secret
|
17
|
+
setting :openid_metadata_url, constructor: ->(url) { URI(url) }
|
18
|
+
setting :cache
|
19
|
+
setting :cache_options
|
20
|
+
setting :user_finder, default: proc {}
|
21
|
+
end
|
22
|
+
|
23
|
+
Warden::Strategies.add(:openid, WardenOpenidAuth::Strategy)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/warden_openid_auth/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'warden_openid_auth'
|
7
|
+
spec.version = WardenOpenidAuth::VERSION
|
8
|
+
spec.authors = ['Blayne Farinha']
|
9
|
+
spec.email = ['blayne.farinha@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'A warden strategy to login via OpenID'
|
12
|
+
spec.homepage = 'https://github.com/blafri/warden_openid_auth'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
spec.required_ruby_version = '>= 3.0'
|
15
|
+
|
16
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
17
|
+
spec.metadata['source_code_uri'] = 'https://github.com/blafri/warden_openid_auth'
|
18
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
24
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
25
|
+
end
|
26
|
+
end
|
27
|
+
spec.bindir = 'exe'
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ['lib']
|
30
|
+
|
31
|
+
# Uncomment to register a new dependency of your gem
|
32
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
33
|
+
spec.add_dependency 'dry-configurable', '~> 0.14'
|
34
|
+
spec.add_dependency 'faraday', '~> 2.2'
|
35
|
+
spec.add_dependency 'faraday-retry', '~> 1.0'
|
36
|
+
spec.add_dependency 'jwt', '~> 2.3'
|
37
|
+
spec.add_dependency 'dry-monads', '~> 1.4'
|
38
|
+
spec.add_dependency 'warden', '~> 1.2'
|
39
|
+
|
40
|
+
# For more information and examples about making a new gem, checkout our
|
41
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: warden_openid_auth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Blayne Farinha
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-03-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dry-configurable
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.14'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday-retry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jwt
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.3'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: dry-monads
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.4'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: warden
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.2'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.2'
|
97
|
+
description:
|
98
|
+
email:
|
99
|
+
- blayne.farinha@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".rspec"
|
105
|
+
- ".rubocop.yml"
|
106
|
+
- Gemfile
|
107
|
+
- Gemfile.lock
|
108
|
+
- LICENSE.txt
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- bin/console
|
112
|
+
- bin/setup
|
113
|
+
- lib/warden_openid_auth.rb
|
114
|
+
- lib/warden_openid_auth/errors.rb
|
115
|
+
- lib/warden_openid_auth/jwks.rb
|
116
|
+
- lib/warden_openid_auth/openid_metadata.rb
|
117
|
+
- lib/warden_openid_auth/strategy.rb
|
118
|
+
- lib/warden_openid_auth/version.rb
|
119
|
+
- warden_openid_auth.gemspec
|
120
|
+
homepage: https://github.com/blafri/warden_openid_auth
|
121
|
+
licenses:
|
122
|
+
- MIT
|
123
|
+
metadata:
|
124
|
+
homepage_uri: https://github.com/blafri/warden_openid_auth
|
125
|
+
source_code_uri: https://github.com/blafri/warden_openid_auth
|
126
|
+
rubygems_mfa_required: 'true'
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '3.0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubygems_version: 3.2.32
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: A warden strategy to login via OpenID
|
146
|
+
test_files: []
|