intuit-oauth 1.0.1 → 1.0.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.
- checksums.yaml +5 -5
- data/intuit-oauth.gemspec +2 -2
- data/lib/intuit-oauth/exception.rb +5 -3
- data/lib/intuit-oauth/flow/openid.rb +5 -5
- data/lib/intuit-oauth/transport.rb +2 -2
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 12821c6352e5bf265380ac1fb09c2358a4585b1d56cf073208c170224b47d97d
|
4
|
+
data.tar.gz: 4e819552523026b9e155c69c1bd2b4c33399a9cb731a0a84767d1255420912c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e466d2b4ce47decf87a91e1052e81ff8f349f63fc7a26c1e79389dbed69313917bb0ddaa6db4a2fefc92ed3a2b81d59e5d3ad2ac54fb0f80d8ca8e9c9883601b
|
7
|
+
data.tar.gz: 24fc28bac722206094234c152e1aa3bfa7cfe507936b5bb828f20e389b5b82d879b1f3ad6ba56a58c54e735a67d4bc6a2891bea085dfc16e6e018a51ade6a2dd
|
data/intuit-oauth.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.add_dependency 'httparty', '>= 0.16.3'
|
8
|
-
spec.add_dependency 'json', '
|
8
|
+
spec.add_dependency 'json', '>= 1.8.0'
|
9
9
|
spec.add_dependency 'rsa-pem-from-mod-exp', '~> 0.1.0'
|
10
10
|
|
11
11
|
spec.authors = ['Intuit Inc']
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.required_ruby_version = '>= 1.9.0'
|
18
18
|
spec.required_rubygems_version = '>= 1.3.5'
|
19
19
|
spec.summary = 'A Ruby wrapper for the OAuth 2.0 protocol.'
|
20
|
-
spec.version = '1.0.
|
20
|
+
spec.version = '1.0.3'
|
21
21
|
|
22
22
|
spec.require_paths = %w[lib]
|
23
23
|
spec.bindir = 'exe'
|
@@ -1,12 +1,14 @@
|
|
1
1
|
module IntuitOAuth
|
2
2
|
class OAuth2ClientException < StandardError
|
3
|
+
attr_reader :status_code, :body, :headers, :intuit_tid, :timestamp
|
4
|
+
|
3
5
|
def initialize(response)
|
4
|
-
@
|
6
|
+
@status_code = response.code
|
5
7
|
@body = response.body
|
6
8
|
@headers = response.headers
|
7
9
|
@intuit_tid = response.headers['intuit_tid']
|
8
10
|
@timestamp = response.headers['date']
|
9
|
-
super("HTTP status #{@
|
11
|
+
super("HTTP status #{@status_code}, error message: #{@body}, intuit_tid: #{@intuit_tid} on #{@timestamp}")
|
10
12
|
end
|
11
13
|
end
|
12
|
-
end
|
14
|
+
end
|
@@ -79,16 +79,16 @@ module IntuitOAuth
|
|
79
79
|
# 4. check if the signature is correct
|
80
80
|
response = IntuitOAuth::Transport.request('GET', @client.jwks_uri, nil, nil, false)
|
81
81
|
body = response.body
|
82
|
-
|
83
|
-
|
82
|
+
# loop through all the available keys in jwks_uri & find match with kid from id_token_header_json
|
83
|
+
keys_array = JSON.parse(body)['keys']
|
84
|
+
keys_array.each do |keys|
|
84
85
|
standard_kid = keys.fetch('kid')
|
85
86
|
kid_in_id_token = id_token_header_json.fetch('kid')
|
86
87
|
|
87
|
-
|
88
|
-
return false
|
88
|
+
return true if standard_kid.eql? kid_in_id_token
|
89
89
|
end
|
90
90
|
|
91
|
-
return
|
91
|
+
return false
|
92
92
|
|
93
93
|
end
|
94
94
|
end
|
@@ -31,12 +31,12 @@ module IntuitOAuth
|
|
31
31
|
req_headers = headers.nil? ? user_agent_header : user_agent_header.merge!(headers)
|
32
32
|
|
33
33
|
if method == 'GET'
|
34
|
-
response =
|
34
|
+
response = get(url,
|
35
35
|
headers: req_headers
|
36
36
|
)
|
37
37
|
|
38
38
|
elsif method == 'POST'
|
39
|
-
response =
|
39
|
+
response = post(url,
|
40
40
|
headers: req_headers,
|
41
41
|
body: body
|
42
42
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intuit-oauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Intuit Inc
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.8.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.8.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rsa-pem-from-mod-exp
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,7 +200,7 @@ homepage: https://github.com/intuit/oauth-rubyclient
|
|
200
200
|
licenses:
|
201
201
|
- Apache-2.0
|
202
202
|
metadata: {}
|
203
|
-
post_install_message:
|
203
|
+
post_install_message:
|
204
204
|
rdoc_options: []
|
205
205
|
require_paths:
|
206
206
|
- lib
|
@@ -215,9 +215,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: 1.3.5
|
217
217
|
requirements: []
|
218
|
-
|
219
|
-
|
220
|
-
signing_key:
|
218
|
+
rubygems_version: 3.4.10
|
219
|
+
signing_key:
|
221
220
|
specification_version: 4
|
222
221
|
summary: A Ruby wrapper for the OAuth 2.0 protocol.
|
223
222
|
test_files: []
|