hearth 1.0.0.pre1 → 1.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -4
  3. data/VERSION +1 -1
  4. data/lib/hearth/api_error.rb +15 -1
  5. data/lib/hearth/auth_option.rb +21 -0
  6. data/lib/hearth/auth_schemes/anonymous.rb +21 -0
  7. data/lib/hearth/auth_schemes/http_api_key.rb +16 -0
  8. data/lib/hearth/auth_schemes/http_basic.rb +16 -0
  9. data/lib/hearth/auth_schemes/http_bearer.rb +16 -0
  10. data/lib/hearth/auth_schemes/http_digest.rb +16 -0
  11. data/lib/hearth/auth_schemes.rb +32 -0
  12. data/lib/hearth/checksums.rb +31 -0
  13. data/lib/hearth/client_stubs.rb +130 -0
  14. data/lib/hearth/config/env_provider.rb +53 -0
  15. data/lib/hearth/config/resolver.rb +52 -0
  16. data/lib/hearth/configuration.rb +15 -0
  17. data/lib/hearth/connection_pool.rb +77 -0
  18. data/lib/hearth/context.rb +28 -4
  19. data/lib/hearth/dns/host_address.rb +23 -0
  20. data/lib/hearth/dns/host_resolver.rb +92 -0
  21. data/lib/hearth/dns.rb +48 -0
  22. data/lib/hearth/http/api_error.rb +4 -8
  23. data/lib/hearth/http/client.rb +208 -59
  24. data/lib/hearth/http/error_inspector.rb +85 -0
  25. data/lib/hearth/http/error_parser.rb +18 -20
  26. data/lib/hearth/http/field.rb +64 -0
  27. data/lib/hearth/http/fields.rb +117 -0
  28. data/lib/hearth/http/middleware/content_length.rb +5 -2
  29. data/lib/hearth/http/middleware/content_md5.rb +31 -0
  30. data/lib/hearth/http/middleware/request_compression.rb +157 -0
  31. data/lib/hearth/http/middleware.rb +12 -0
  32. data/lib/hearth/http/networking_error.rb +1 -14
  33. data/lib/hearth/http/request.rb +83 -56
  34. data/lib/hearth/http/response.rb +42 -13
  35. data/lib/hearth/http.rb +14 -5
  36. data/lib/hearth/identities/anonymous.rb +8 -0
  37. data/lib/hearth/identities/http_api_key.rb +16 -0
  38. data/lib/hearth/identities/http_bearer.rb +16 -0
  39. data/lib/hearth/identities/http_login.rb +20 -0
  40. data/lib/hearth/identities.rb +21 -0
  41. data/lib/hearth/identity_resolver.rb +17 -0
  42. data/lib/hearth/interceptor.rb +506 -0
  43. data/lib/hearth/interceptor_context.rb +36 -0
  44. data/lib/hearth/interceptor_list.rb +48 -0
  45. data/lib/hearth/interceptors.rb +75 -0
  46. data/lib/hearth/middleware/auth.rb +100 -0
  47. data/lib/hearth/middleware/build.rb +32 -0
  48. data/lib/hearth/middleware/host_prefix.rb +10 -6
  49. data/lib/hearth/middleware/initialize.rb +58 -0
  50. data/lib/hearth/middleware/parse.rb +45 -6
  51. data/lib/hearth/middleware/retry.rb +97 -23
  52. data/lib/hearth/middleware/send.rb +137 -25
  53. data/lib/hearth/middleware/sign.rb +65 -0
  54. data/lib/hearth/middleware/validate.rb +11 -1
  55. data/lib/hearth/middleware.rb +19 -8
  56. data/lib/hearth/middleware_stack.rb +1 -43
  57. data/lib/hearth/networking_error.rb +18 -0
  58. data/lib/hearth/number_helper.rb +2 -2
  59. data/lib/hearth/output.rb +8 -4
  60. data/lib/hearth/plugin_list.rb +53 -0
  61. data/lib/hearth/query/param.rb +52 -0
  62. data/lib/hearth/query/param_list.rb +54 -0
  63. data/lib/hearth/query/param_matcher.rb +32 -0
  64. data/lib/hearth/refreshing_identity_resolver.rb +63 -0
  65. data/lib/hearth/request.rb +22 -0
  66. data/lib/hearth/response.rb +33 -0
  67. data/lib/hearth/retry/adaptive.rb +60 -0
  68. data/lib/hearth/retry/capacity_not_available_error.rb +9 -0
  69. data/lib/hearth/retry/client_rate_limiter.rb +143 -0
  70. data/lib/hearth/retry/exponential_backoff.rb +15 -0
  71. data/lib/hearth/retry/retry_quota.rb +56 -0
  72. data/lib/hearth/retry/standard.rb +46 -0
  73. data/lib/hearth/retry/strategy.rb +20 -0
  74. data/lib/hearth/retry.rb +16 -0
  75. data/lib/hearth/signers/anonymous.rb +16 -0
  76. data/lib/hearth/signers/http_api_key.rb +29 -0
  77. data/lib/hearth/signers/http_basic.rb +23 -0
  78. data/lib/hearth/signers/http_bearer.rb +19 -0
  79. data/lib/hearth/signers/http_digest.rb +19 -0
  80. data/lib/hearth/signers.rb +23 -0
  81. data/lib/hearth/stubs.rb +30 -0
  82. data/lib/hearth/time_helper.rb +5 -3
  83. data/lib/hearth/validator.rb +44 -5
  84. data/lib/hearth/waiters/poller.rb +6 -7
  85. data/lib/hearth/waiters/waiter.rb +17 -4
  86. data/lib/hearth/xml/formatter.rb +11 -2
  87. data/lib/hearth/xml/node.rb +2 -2
  88. data/lib/hearth.rb +32 -5
  89. data/sig/lib/hearth/aliases.rbs +4 -0
  90. data/sig/lib/hearth/api_error.rbs +13 -0
  91. data/sig/lib/hearth/auth_option.rbs +11 -0
  92. data/sig/lib/hearth/auth_schemes/anonymous.rbs +7 -0
  93. data/sig/lib/hearth/auth_schemes/http_api_key.rbs +7 -0
  94. data/sig/lib/hearth/auth_schemes/http_basic.rbs +7 -0
  95. data/sig/lib/hearth/auth_schemes/http_bearer.rbs +7 -0
  96. data/sig/lib/hearth/auth_schemes/http_digest.rbs +7 -0
  97. data/sig/lib/hearth/auth_schemes.rbs +13 -0
  98. data/sig/lib/hearth/block_io.rbs +9 -0
  99. data/sig/lib/hearth/client_stubs.rbs +5 -0
  100. data/sig/lib/hearth/configuration.rbs +7 -0
  101. data/sig/lib/hearth/dns/host_address.rbs +13 -0
  102. data/sig/lib/hearth/dns/host_resolver.rbs +19 -0
  103. data/sig/lib/hearth/http/api_error.rbs +13 -0
  104. data/sig/lib/hearth/http/client.rbs +9 -0
  105. data/sig/lib/hearth/http/field.rbs +19 -0
  106. data/sig/lib/hearth/http/fields.rbs +43 -0
  107. data/sig/lib/hearth/http/request.rbs +25 -0
  108. data/sig/lib/hearth/http/response.rbs +21 -0
  109. data/sig/lib/hearth/identities/anonymous.rbs +6 -0
  110. data/sig/lib/hearth/identities/http_api_key.rbs +9 -0
  111. data/sig/lib/hearth/identities/http_bearer.rbs +9 -0
  112. data/sig/lib/hearth/identities/http_login.rbs +11 -0
  113. data/sig/lib/hearth/identities.rbs +9 -0
  114. data/sig/lib/hearth/identity_resolver.rbs +7 -0
  115. data/sig/lib/hearth/interceptor.rbs +9 -0
  116. data/sig/lib/hearth/interceptor_context.rbs +15 -0
  117. data/sig/lib/hearth/interceptor_list.rbs +16 -0
  118. data/sig/lib/hearth/interfaces.rbs +65 -0
  119. data/sig/lib/hearth/output.rbs +11 -0
  120. data/sig/lib/hearth/plugin_list.rbs +15 -0
  121. data/sig/lib/hearth/query/param.rbs +17 -0
  122. data/sig/lib/hearth/query/param_list.rbs +25 -0
  123. data/sig/lib/hearth/request.rbs +9 -0
  124. data/sig/lib/hearth/response.rbs +11 -0
  125. data/sig/lib/hearth/retry/adaptive.rbs +13 -0
  126. data/sig/lib/hearth/retry/exponential_backoff.rbs +7 -0
  127. data/sig/lib/hearth/retry/standard.rbs +13 -0
  128. data/sig/lib/hearth/retry/strategy.rbs +11 -0
  129. data/sig/lib/hearth/retry.rbs +9 -0
  130. data/sig/lib/hearth/signers/anonymous.rbs +9 -0
  131. data/sig/lib/hearth/signers/http_api_key.rbs +9 -0
  132. data/sig/lib/hearth/signers/http_basic.rbs +9 -0
  133. data/sig/lib/hearth/signers/http_bearer.rbs +9 -0
  134. data/sig/lib/hearth/signers/http_digest.rbs +9 -0
  135. data/sig/lib/hearth/signers.rbs +9 -0
  136. data/sig/lib/hearth/structure.rbs +7 -0
  137. data/sig/lib/hearth/union.rbs +5 -0
  138. data/sig/lib/hearth/waiters/waiter.rbs +17 -0
  139. metadata +132 -22
  140. data/lib/hearth/http/headers.rb +0 -70
  141. data/lib/hearth/middleware/around_handler.rb +0 -24
  142. data/lib/hearth/middleware/request_handler.rb +0 -24
  143. data/lib/hearth/middleware/response_handler.rb +0 -25
  144. data/lib/hearth/middleware_builder.rb +0 -246
  145. data/lib/hearth/stubbing/client_stubs.rb +0 -115
  146. data/lib/hearth/stubbing/stubs.rb +0 -32
  147. data/lib/hearth/waiters/errors.rb +0 -15
  148. data/sig/lib/seahorse/api_error.rbs +0 -10
  149. data/sig/lib/seahorse/document.rbs +0 -2
  150. data/sig/lib/seahorse/http/api_error.rbs +0 -21
  151. data/sig/lib/seahorse/http/headers.rbs +0 -47
  152. data/sig/lib/seahorse/http/response.rbs +0 -21
  153. data/sig/lib/seahorse/simple_delegator.rbs +0 -3
  154. data/sig/lib/seahorse/structure.rbs +0 -18
  155. data/sig/lib/seahorse/stubbing/client_stubs.rbs +0 -103
  156. data/sig/lib/seahorse/stubbing/stubs.rbs +0 -14
  157. data/sig/lib/seahorse/union.rbs +0 -6
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module Retry
3
+ class Token < Struct[untyped]
4
+ attr_accessor retry_count (): Integer
5
+
6
+ attr_accessor retry_delay (): Float
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module Signers
3
+ class Anonymous < Signers::Base
4
+ def sign: (request: Request, identity: Identities::Anonymous, ?properties: Hash[Symbol, untyped]) -> void
5
+
6
+ def reset: (request: Request, ?properties: Hash[Symbol, untyped]) -> void
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module Signers
3
+ class HTTPApiKey < Signers::Base
4
+ def sign: (request: HTTP::Request, identity: Identities::HTTPApiKey, ?properties: Hash[Symbol, untyped]) -> void
5
+
6
+ def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module Signers
3
+ class HTTPBasic < Signers::Base
4
+ def sign: (request: HTTP::Request, identity: Identities::HTTPLogin, ?properties: Hash[Symbol, untyped]) -> void
5
+
6
+ def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module Signers
3
+ class HTTPBearer < Signers::Base
4
+ def sign: (request: HTTP::Request, identity: Identities::HTTPBearer, ?properties: Hash[Symbol, untyped]) -> void
5
+
6
+ def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module Signers
3
+ class HTTPDigest < Signers::Base
4
+ def sign: (request: HTTP::Request, identity: Identities::HTTPLogin, ?properties: Hash[Symbol, untyped]) -> void
5
+
6
+ def reset: (request: HTTP::Request, ?properties: Hash[Symbol, untyped]) -> void
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Hearth
2
+ module Signers
3
+ class Base
4
+ def sign: (request: Request, identity: Identities::Base, ?properties: Hash[Symbol, untyped]) -> void
5
+
6
+ def reset: (request: Request, ?properties: Hash[Symbol, untyped]) -> void
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Hearth
2
+ module Structure
3
+ def to_h: (self) -> Hash[Symbol, untyped]
4
+
5
+ alias to_hash to_h
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Hearth
2
+ class Union < SimpleDelegator
3
+ include Hearth::Structure
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hearth
4
+ module Waiters
5
+ class WaiterFailed < StandardError
6
+ end
7
+
8
+ class FailureStateError < WaiterFailed
9
+ end
10
+
11
+ class MaxWaitTimeExceededError < WaiterFailed
12
+ end
13
+
14
+ class UnexpectedError < WaiterFailed
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hearth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre1
4
+ version: 1.0.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2023-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -24,6 +24,26 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rexml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.2'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 3.2.4
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '3.2'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.2.4
27
47
  description:
28
48
  email:
29
49
  executables: []
@@ -34,40 +54,90 @@ files:
34
54
  - VERSION
35
55
  - lib/hearth.rb
36
56
  - lib/hearth/api_error.rb
57
+ - lib/hearth/auth_option.rb
58
+ - lib/hearth/auth_schemes.rb
59
+ - lib/hearth/auth_schemes/anonymous.rb
60
+ - lib/hearth/auth_schemes/http_api_key.rb
61
+ - lib/hearth/auth_schemes/http_basic.rb
62
+ - lib/hearth/auth_schemes/http_bearer.rb
63
+ - lib/hearth/auth_schemes/http_digest.rb
37
64
  - lib/hearth/block_io.rb
65
+ - lib/hearth/checksums.rb
66
+ - lib/hearth/client_stubs.rb
67
+ - lib/hearth/config/env_provider.rb
68
+ - lib/hearth/config/resolver.rb
69
+ - lib/hearth/configuration.rb
70
+ - lib/hearth/connection_pool.rb
38
71
  - lib/hearth/context.rb
72
+ - lib/hearth/dns.rb
73
+ - lib/hearth/dns/host_address.rb
74
+ - lib/hearth/dns/host_resolver.rb
39
75
  - lib/hearth/http.rb
40
76
  - lib/hearth/http/api_error.rb
41
77
  - lib/hearth/http/client.rb
78
+ - lib/hearth/http/error_inspector.rb
42
79
  - lib/hearth/http/error_parser.rb
43
- - lib/hearth/http/headers.rb
80
+ - lib/hearth/http/field.rb
81
+ - lib/hearth/http/fields.rb
82
+ - lib/hearth/http/middleware.rb
44
83
  - lib/hearth/http/middleware/content_length.rb
84
+ - lib/hearth/http/middleware/content_md5.rb
85
+ - lib/hearth/http/middleware/request_compression.rb
45
86
  - lib/hearth/http/networking_error.rb
46
87
  - lib/hearth/http/request.rb
47
88
  - lib/hearth/http/response.rb
89
+ - lib/hearth/identities.rb
90
+ - lib/hearth/identities/anonymous.rb
91
+ - lib/hearth/identities/http_api_key.rb
92
+ - lib/hearth/identities/http_bearer.rb
93
+ - lib/hearth/identities/http_login.rb
94
+ - lib/hearth/identity_resolver.rb
95
+ - lib/hearth/interceptor.rb
96
+ - lib/hearth/interceptor_context.rb
97
+ - lib/hearth/interceptor_list.rb
98
+ - lib/hearth/interceptors.rb
48
99
  - lib/hearth/json.rb
49
100
  - lib/hearth/json/parse_error.rb
50
101
  - lib/hearth/middleware.rb
51
- - lib/hearth/middleware/around_handler.rb
102
+ - lib/hearth/middleware/auth.rb
52
103
  - lib/hearth/middleware/build.rb
53
104
  - lib/hearth/middleware/host_prefix.rb
105
+ - lib/hearth/middleware/initialize.rb
54
106
  - lib/hearth/middleware/parse.rb
55
- - lib/hearth/middleware/request_handler.rb
56
- - lib/hearth/middleware/response_handler.rb
57
107
  - lib/hearth/middleware/retry.rb
58
108
  - lib/hearth/middleware/send.rb
109
+ - lib/hearth/middleware/sign.rb
59
110
  - lib/hearth/middleware/validate.rb
60
- - lib/hearth/middleware_builder.rb
61
111
  - lib/hearth/middleware_stack.rb
112
+ - lib/hearth/networking_error.rb
62
113
  - lib/hearth/number_helper.rb
63
114
  - lib/hearth/output.rb
115
+ - lib/hearth/plugin_list.rb
116
+ - lib/hearth/query/param.rb
117
+ - lib/hearth/query/param_list.rb
118
+ - lib/hearth/query/param_matcher.rb
119
+ - lib/hearth/refreshing_identity_resolver.rb
120
+ - lib/hearth/request.rb
121
+ - lib/hearth/response.rb
122
+ - lib/hearth/retry.rb
123
+ - lib/hearth/retry/adaptive.rb
124
+ - lib/hearth/retry/capacity_not_available_error.rb
125
+ - lib/hearth/retry/client_rate_limiter.rb
126
+ - lib/hearth/retry/exponential_backoff.rb
127
+ - lib/hearth/retry/retry_quota.rb
128
+ - lib/hearth/retry/standard.rb
129
+ - lib/hearth/retry/strategy.rb
130
+ - lib/hearth/signers.rb
131
+ - lib/hearth/signers/anonymous.rb
132
+ - lib/hearth/signers/http_api_key.rb
133
+ - lib/hearth/signers/http_basic.rb
134
+ - lib/hearth/signers/http_bearer.rb
135
+ - lib/hearth/signers/http_digest.rb
64
136
  - lib/hearth/structure.rb
65
- - lib/hearth/stubbing/client_stubs.rb
66
- - lib/hearth/stubbing/stubs.rb
137
+ - lib/hearth/stubs.rb
67
138
  - lib/hearth/time_helper.rb
68
139
  - lib/hearth/union.rb
69
140
  - lib/hearth/validator.rb
70
- - lib/hearth/waiters/errors.rb
71
141
  - lib/hearth/waiters/poller.rb
72
142
  - lib/hearth/waiters/waiter.rb
73
143
  - lib/hearth/xml.rb
@@ -75,16 +145,56 @@ files:
75
145
  - lib/hearth/xml/node.rb
76
146
  - lib/hearth/xml/node_matcher.rb
77
147
  - lib/hearth/xml/parse_error.rb
78
- - sig/lib/seahorse/api_error.rbs
79
- - sig/lib/seahorse/document.rbs
80
- - sig/lib/seahorse/http/api_error.rbs
81
- - sig/lib/seahorse/http/headers.rbs
82
- - sig/lib/seahorse/http/response.rbs
83
- - sig/lib/seahorse/simple_delegator.rbs
84
- - sig/lib/seahorse/structure.rbs
85
- - sig/lib/seahorse/stubbing/client_stubs.rbs
86
- - sig/lib/seahorse/stubbing/stubs.rbs
87
- - sig/lib/seahorse/union.rbs
148
+ - sig/lib/hearth/aliases.rbs
149
+ - sig/lib/hearth/api_error.rbs
150
+ - sig/lib/hearth/auth_option.rbs
151
+ - sig/lib/hearth/auth_schemes.rbs
152
+ - sig/lib/hearth/auth_schemes/anonymous.rbs
153
+ - sig/lib/hearth/auth_schemes/http_api_key.rbs
154
+ - sig/lib/hearth/auth_schemes/http_basic.rbs
155
+ - sig/lib/hearth/auth_schemes/http_bearer.rbs
156
+ - sig/lib/hearth/auth_schemes/http_digest.rbs
157
+ - sig/lib/hearth/block_io.rbs
158
+ - sig/lib/hearth/client_stubs.rbs
159
+ - sig/lib/hearth/configuration.rbs
160
+ - sig/lib/hearth/dns/host_address.rbs
161
+ - sig/lib/hearth/dns/host_resolver.rbs
162
+ - sig/lib/hearth/http/api_error.rbs
163
+ - sig/lib/hearth/http/client.rbs
164
+ - sig/lib/hearth/http/field.rbs
165
+ - sig/lib/hearth/http/fields.rbs
166
+ - sig/lib/hearth/http/request.rbs
167
+ - sig/lib/hearth/http/response.rbs
168
+ - sig/lib/hearth/identities.rbs
169
+ - sig/lib/hearth/identities/anonymous.rbs
170
+ - sig/lib/hearth/identities/http_api_key.rbs
171
+ - sig/lib/hearth/identities/http_bearer.rbs
172
+ - sig/lib/hearth/identities/http_login.rbs
173
+ - sig/lib/hearth/identity_resolver.rbs
174
+ - sig/lib/hearth/interceptor.rbs
175
+ - sig/lib/hearth/interceptor_context.rbs
176
+ - sig/lib/hearth/interceptor_list.rbs
177
+ - sig/lib/hearth/interfaces.rbs
178
+ - sig/lib/hearth/output.rbs
179
+ - sig/lib/hearth/plugin_list.rbs
180
+ - sig/lib/hearth/query/param.rbs
181
+ - sig/lib/hearth/query/param_list.rbs
182
+ - sig/lib/hearth/request.rbs
183
+ - sig/lib/hearth/response.rbs
184
+ - sig/lib/hearth/retry.rbs
185
+ - sig/lib/hearth/retry/adaptive.rbs
186
+ - sig/lib/hearth/retry/exponential_backoff.rbs
187
+ - sig/lib/hearth/retry/standard.rbs
188
+ - sig/lib/hearth/retry/strategy.rbs
189
+ - sig/lib/hearth/signers.rbs
190
+ - sig/lib/hearth/signers/anonymous.rbs
191
+ - sig/lib/hearth/signers/http_api_key.rbs
192
+ - sig/lib/hearth/signers/http_basic.rbs
193
+ - sig/lib/hearth/signers/http_bearer.rbs
194
+ - sig/lib/hearth/signers/http_digest.rbs
195
+ - sig/lib/hearth/structure.rbs
196
+ - sig/lib/hearth/union.rbs
197
+ - sig/lib/hearth/waiters/waiter.rbs
88
198
  homepage:
89
199
  licenses:
90
200
  - Apache-2.0
@@ -97,14 +207,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
207
  requirements:
98
208
  - - ">="
99
209
  - !ruby/object:Gem::Version
100
- version: '2.5'
210
+ version: '3.0'
101
211
  required_rubygems_version: !ruby/object:Gem::Requirement
102
212
  requirements:
103
213
  - - ">"
104
214
  - !ruby/object:Gem::Version
105
215
  version: 1.3.1
106
216
  requirements: []
107
- rubygems_version: 3.2.22
217
+ rubygems_version: 3.4.22
108
218
  signing_key:
109
219
  specification_version: 4
110
220
  summary: A base library for Smithy generated SDKs
@@ -1,70 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Hearth
4
- module HTTP
5
- # Provides Hash like access for Headers with key normalization
6
- # @api private
7
- class Headers
8
- # @param [Hash<String,String>] headers
9
- def initialize(headers: {})
10
- @headers = {}
11
- headers.each_pair do |key, value|
12
- self[key] = value
13
- end
14
- end
15
-
16
- # @param [String] key
17
- def [](key)
18
- @headers[normalize(key)]
19
- end
20
-
21
- # @param [String] key
22
- # @param [String] value
23
- def []=(key, value)
24
- @headers[normalize(key)] = value.to_s
25
- end
26
-
27
- # @param [String] key
28
- # @return [Boolean] Returns `true` if there is a header with
29
- # the given key.
30
- def key?(key)
31
- @headers.key?(normalize(key))
32
- end
33
-
34
- # @return [Array<String>]
35
- def keys
36
- @headers.keys
37
- end
38
-
39
- # @param [String] key
40
- # @return [String, nil] Returns the value for the deleted key.
41
- def delete(key)
42
- @headers.delete(normalize(key))
43
- end
44
-
45
- # @return [Enumerable<String,String>]
46
- def each_pair(&block)
47
- @headers.each(&block)
48
- end
49
- alias each each_pair
50
-
51
- # @return [Hash]
52
- def to_hash
53
- @headers.dup
54
- end
55
- alias to_h to_hash
56
-
57
- # @return [Integer] Returns the number of entries in the headers
58
- # hash.
59
- def size
60
- @headers.size
61
- end
62
-
63
- private
64
-
65
- def normalize(key)
66
- key.to_s.gsub(/[^-]+/, &:capitalize)
67
- end
68
- end
69
- end
70
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Hearth
4
- module Middleware
5
- # A class used to register middleware around a request.
6
- # @api private
7
- class AroundHandler
8
- # @param [Class] app The next middleware in the stack.
9
- # @param [Proc] handler A proc object that is called around the request.
10
- # The proc must return the next middleware.
11
- def initialize(app, handler:)
12
- @app = app
13
- @handler = handler
14
- end
15
-
16
- # @param input
17
- # @param context
18
- # @return [Output]
19
- def call(input, context)
20
- @handler.call(@app, input, context)
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Hearth
4
- module Middleware
5
- # A class used to register middleware before a request is sent.
6
- # @api private
7
- class RequestHandler
8
- # @param [Class] app The next middleware in the stack.
9
- # @param [Proc] handler A proc object that is called before the request.
10
- def initialize(app, handler:)
11
- @app = app
12
- @handler = handler
13
- end
14
-
15
- # @param input
16
- # @param context
17
- # @return [Output]
18
- def call(input, context)
19
- @handler.call(input, context)
20
- @app.call(input, context)
21
- end
22
- end
23
- end
24
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Hearth
4
- module Middleware
5
- # A class used to register middleware after a request is sent.
6
- # @api private
7
- class ResponseHandler
8
- # @param [Class] app The next middleware in the stack.
9
- # @param [Proc] handler A proc object that is called after the request.
10
- def initialize(app, handler:)
11
- @app = app
12
- @handler = handler
13
- end
14
-
15
- # @param input
16
- # @param context
17
- # @return [Output]
18
- def call(input, context)
19
- output = @app.call(input, context)
20
- @handler.call(output, context)
21
- output
22
- end
23
- end
24
- end
25
- end