warden_openid_auth 0.1.1 → 0.1.2

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: 7409c4b89935d4bb94333351825bce0bd75e018d18eca165a2d787378d0f79c6
4
- data.tar.gz: d59c33b1af6d7871a68cc6f0d8c0c79024859a6e6f0b95eea8e791aa71deea5e
3
+ metadata.gz: c5c8cbe6ff3087e76573bb87a3c777861df71cecf7d9982a5135fee447397190
4
+ data.tar.gz: da07e4f4e161be1c901ccbf5838ab2bb60a2273ccd852455999654a5551e64c9
5
5
  SHA512:
6
- metadata.gz: dcf61e5555e43522f78e45c313bbdf182382152e67b62d4a58c77ce212021d063d02844e3a3029011a0669eb3e2bc1802cbe2f03592b591fae28bbf59f37fdfe
7
- data.tar.gz: cc9a607dc446a10d3c3de77f8f86e8382d8c32600e677de513026da78f0af3774a3e6c469f0350d53ce3e754691af7a66f00d1b57b4d7c5786cbc2c15d21c83e
6
+ metadata.gz: 1980d54b695b55baed289d01005a5f33fa5703bb63fcf99364ad467940f6c67dfbfbc0f41907bb25992ba47b7f731f8b92c2a1691e546b09a1020e60fabec651
7
+ data.tar.gz: 8d016d4678a66651c39ecb082406e52023ce24173aa888c55dca4846f770d71e50d076a54b0249f658bbdb49d57148b520945c9e676cdc50c4a79654f6845762
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- warden_openid_auth (0.1.1)
4
+ warden_openid_auth (0.1.2)
5
5
  dry-configurable (~> 0.14)
6
6
  dry-monads (~> 1.4)
7
7
  faraday (~> 2.2)
@@ -20,37 +20,32 @@ module WardenOpenidAuth
20
20
  @client_id = config.client_id
21
21
  end
22
22
 
23
- # @return [String] the endpoint for authorization
24
- def authorization_endpoint
25
- config_document['authorization_endpoint']
26
- end
27
-
28
23
  # @return [String] the full URL for authorization including parameters
29
24
  def authorization_url(redirect_uri:, state:, scope: 'openid profile email')
30
- uri = URI(authorization_endpoint)
25
+ uri = URI(config_document['authorization_endpoint'])
31
26
  uri.query = "client_id=#{url_encode(client_id)}&redirect_uri=#{url_encode(redirect_uri)}" \
32
27
  "&scope=#{url_encode(scope)}&state=#{url_encode(state)}&response_mode=query&response_type=code"
33
28
  uri.to_s
34
29
  end
35
30
 
36
- # @return [String] the endpoint to hit to get tokens.
37
- def token_endpoint
38
- config_document['token_endpoint']
31
+ # @return [Hash] a hash representation of the OpenID configuration document.
32
+ def to_h
33
+ config_document
39
34
  end
40
35
 
41
- # @return [String] the endpoint to hit to get the JSON Web Key Set.
42
- def jwks_uri
43
- config_document['jwks_uri']
36
+ # Check if the method asked for is a key in the config_document. If it is return it. Otherwise
37
+ # call parent which will throw a NoMethodError error.
38
+ def method_missing(name)
39
+ config_document.fetch(name.to_s) { super }
44
40
  end
45
41
 
46
- # @return [String] the issuer according to the metadata document.
47
- def issuer
48
- config_document['issuer']
49
- end
42
+ # if the the object does not respond to the method passed to respond_to? Check if the method
43
+ # called is a key on config_document, if it is respond with true indicating that the object does
44
+ # respond to that method.
45
+ def respond_to_missing?(name)
46
+ return true if config_document.include?(name.to_s)
50
47
 
51
- # @return [Hash] a hash representation of the OpenID configuration document.
52
- def to_h
53
- config_document
48
+ super
54
49
  end
55
50
 
56
51
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WardenOpenidAuth
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden_openid_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blayne Farinha
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-04 00:00:00.000000000 Z
11
+ date: 2022-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable