setsuzoku 0.14.0 → 0.14.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4233d295eb8e38d96442e9727a7325cf1b7673f41fd1575af095a4c89563213c
4
- data.tar.gz: a25508116b564e0fdc9aaa007b56a72404b8f7116d7fe7506e008337717a649c
3
+ metadata.gz: c68b8e446e254327e1fb77b56723ca9348b877c836ccf45af3fc6adc68843e53
4
+ data.tar.gz: 2eb7c02aaae36025863d5ac2f32fbcfbb37a396fea1798e61dad4fabb2293af2
5
5
  SHA512:
6
- metadata.gz: a2257bb847f9e182885aa367ac5c886517460b57f9e84fd4f043678f1767da72c6d39fc32bc5c0a9efd92b57f0e582ff1b08d9ba4b7f008959bd20b55e1eddcd
7
- data.tar.gz: e5bd652f32e76a02e2c34e6afbec22920afc44ec9c96503d2a78b00ef5da62c1e87f013a9919ee20ce9c0788b82473f93164e770ecc3abda86ee65cee1a1ba00
6
+ metadata.gz: 074d9f443890fd7e41178844db8308e17bfa7e7ab439c68cb32cf756686d0ceab2b823627a4dc846fcaa9887f2a7b93b910bd1f687ccf51540bb23a09af36a1d
7
+ data.tar.gz: 35301825f50aab57fcdb3a1064394bfcab1fe524a79672c94b657785a852132e4ec53a0dcccfa70750a3ecd9760bebe77905499092d3e2333e074d259578cb45
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- setsuzoku (0.14.0)
4
+ setsuzoku (0.14.4)
5
5
  activesupport (>= 5.0, < 7)
6
6
  faraday (~> 0.11)
7
7
  nokogiri (~> 1.10)
@@ -52,7 +52,7 @@ GEM
52
52
  safe_yaml (1.0.5)
53
53
  sorbet (0.5.5675)
54
54
  sorbet-static (= 0.5.5675)
55
- sorbet-runtime (0.5.6466)
55
+ sorbet-runtime (0.5.6497)
56
56
  sorbet-static (0.5.5675-universal-darwin-14)
57
57
  tzinfo (2.0.4)
58
58
  concurrent-ruby (~> 1.0)
@@ -81,7 +81,8 @@ module Setsuzoku
81
81
  def parse_response(response:, **options)
82
82
  case options[:response_type]
83
83
  when :json
84
- JSON.parse(response.body).deep_symbolize_keys
84
+ resp = JSON.parse(response.body)
85
+ resp.is_a?(Hash) ? resp.deep_symbolize_keys : resp
85
86
  when :xml
86
87
  convert_xml_to_hash(response.body)
87
88
  when :html
@@ -97,7 +98,8 @@ module Setsuzoku
97
98
  # t.rewind
98
99
  # t
99
100
  else
100
- JSON.parse(response.body).deep_symbolize_keys
101
+ resp = JSON.parse(response.body)
102
+ resp.is_a?(Hash) ? resp.deep_symbolize_keys : resp
101
103
  end
102
104
  end
103
105
 
@@ -146,18 +146,6 @@ module Setsuzoku
146
146
 
147
147
  self.credential.set_token!(resp)
148
148
  end
149
-
150
- #
151
- # set_token!
152
- sig { abstract.params(resp: Setsuzoku::ApiResponse, attrs: T::Hash[Symbol, T.untyped]).void }
153
- #
154
- # Persist relevant token and response data after authentication.
155
- #
156
- # @param resp [Setsuzoku::ApiResponse] the successful response for an authentication token.
157
- # @param attrs [Hash] additional attrs that can be set by a specific credential implementation.
158
- #
159
- # @return [void]
160
- def set_token!(resp, attrs); end
161
149
  end
162
150
  end
163
151
  end
@@ -53,14 +53,14 @@ module Setsuzoku
53
53
  sig{ abstract.params(val: DateTime).returns(T.nilable(DateTime)) }
54
54
  def expires_on=(val); end
55
55
 
56
- # Alternatively, a credential can manually handle what to do with a token response.
57
- # For instance, storing multiple tokens as sub-resources
56
+ # All credentials must have some implementation of storing their token details.
58
57
  #
59
- # @param resp [Hash] the response hash from the external api call for a token.
58
+ # @param resp [Setsuzoku::ApiResponse] the response hash from the external api call for a token.
59
+ # @param attrs [Hash] additional attrs to be passed to super if desired.
60
60
  #
61
61
  # @return [Hash] the attributes to assign to the credential.
62
- sig{ abstract.params(resp: T::Hash[Symbol, T.untyped]).void }
63
- def set_token!; end
62
+ sig { abstract.params(resp: Setsuzoku::ApiResponse, attrs: T.nilable(T::Hash[Symbol, T.untyped])).void }
63
+ def set_token!(resp, attrs); end
64
64
  end
65
65
  end
66
66
  end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Setsuzoku
5
- VERSION = '0.14.0'
5
+ VERSION = '0.14.4'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: setsuzoku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Stadtler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-28 00:00:00.000000000 Z
11
+ date: 2021-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler