httpx 1.7.5 → 1.7.7

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes/1_7_4.md +1 -1
  3. data/doc/release_notes/1_7_6.md +24 -0
  4. data/doc/release_notes/1_7_7.md +17 -0
  5. data/lib/httpx/adapters/datadog.rb +14 -1
  6. data/lib/httpx/adapters/faraday.rb +0 -10
  7. data/lib/httpx/adapters/webmock.rb +1 -1
  8. data/lib/httpx/altsvc.rb +4 -2
  9. data/lib/httpx/connection/http1.rb +52 -43
  10. data/lib/httpx/connection/http2.rb +23 -16
  11. data/lib/httpx/connection.rb +80 -43
  12. data/lib/httpx/io/ssl.rb +24 -12
  13. data/lib/httpx/io/tcp.rb +18 -12
  14. data/lib/httpx/io/unix.rb +13 -9
  15. data/lib/httpx/loggable.rb +1 -1
  16. data/lib/httpx/options.rb +23 -7
  17. data/lib/httpx/parser/http1.rb +14 -5
  18. data/lib/httpx/plugins/auth/digest.rb +6 -0
  19. data/lib/httpx/plugins/auth.rb +23 -9
  20. data/lib/httpx/plugins/circuit_breaker/circuit.rb +1 -0
  21. data/lib/httpx/plugins/cookies/cookie.rb +0 -1
  22. data/lib/httpx/plugins/digest_auth.rb +3 -1
  23. data/lib/httpx/plugins/follow_redirects.rb +13 -1
  24. data/lib/httpx/plugins/h2c.rb +2 -12
  25. data/lib/httpx/plugins/proxy/http.rb +1 -1
  26. data/lib/httpx/plugins/proxy.rb +1 -1
  27. data/lib/httpx/plugins/response_cache.rb +11 -4
  28. data/lib/httpx/plugins/retries.rb +6 -6
  29. data/lib/httpx/plugins/ssrf_filter.rb +1 -1
  30. data/lib/httpx/plugins/tracing.rb +1 -6
  31. data/lib/httpx/plugins/upgrade/h2.rb +1 -11
  32. data/lib/httpx/plugins/upgrade.rb +17 -17
  33. data/lib/httpx/pool.rb +7 -9
  34. data/lib/httpx/request.rb +28 -3
  35. data/lib/httpx/resolver/native.rb +1 -1
  36. data/lib/httpx/response.rb +5 -1
  37. data/lib/httpx/selector.rb +18 -10
  38. data/lib/httpx/session.rb +32 -24
  39. data/lib/httpx/version.rb +1 -1
  40. data/sig/altsvc.rbs +2 -0
  41. data/sig/connection/http1.rbs +4 -2
  42. data/sig/connection/http2.rbs +1 -1
  43. data/sig/connection.rbs +9 -2
  44. data/sig/io/ssl.rbs +1 -0
  45. data/sig/io/tcp.rbs +2 -2
  46. data/sig/loggable.rbs +1 -1
  47. data/sig/options.rbs +8 -3
  48. data/sig/parser/http1.rbs +1 -1
  49. data/sig/plugins/auth/basic.rbs +1 -1
  50. data/sig/plugins/auth/digest.rbs +1 -1
  51. data/sig/plugins/auth/ntlm.rbs +2 -0
  52. data/sig/plugins/auth.rbs +5 -2
  53. data/sig/plugins/follow_redirects.rbs +1 -1
  54. data/sig/plugins/proxy.rbs +1 -0
  55. data/sig/plugins/response_cache.rbs +2 -0
  56. data/sig/plugins/retries.rbs +1 -1
  57. data/sig/plugins/tracing.rbs +1 -1
  58. data/sig/pool.rbs +1 -1
  59. data/sig/request.rbs +6 -0
  60. data/sig/session.rbs +0 -2
  61. metadata +5 -1
data/sig/io/ssl.rbs CHANGED
@@ -8,6 +8,7 @@ module HTTPX
8
8
 
9
9
  @ctx: OpenSSL::SSL::SSLContext
10
10
  @verify_hostname: bool
11
+ @sni_hostname: String
11
12
 
12
13
  attr_writer ssl_session: OpenSSL::SSL::Session?
13
14
 
data/sig/io/tcp.rbs CHANGED
@@ -46,7 +46,7 @@ module HTTPX
46
46
 
47
47
  public
48
48
 
49
- def read: (Integer size, ?(Buffer | String) buffer) -> (0 | nil | untyped)
49
+ def read: (Integer size, Buffer | String buffer) -> (0 | nil | untyped)
50
50
 
51
51
  def write: (Buffer buffer) -> Integer?
52
52
 
@@ -67,6 +67,6 @@ module HTTPX
67
67
 
68
68
  def do_transition: (Symbol nextstate) -> void
69
69
 
70
- def log_transition_state: (Symbol nextstate) -> void
70
+ def log_transition_state: (Symbol nextstate) -> String
71
71
  end
72
72
  end
data/sig/loggable.rbs CHANGED
@@ -16,6 +16,6 @@ module HTTPX
16
16
 
17
17
  def log_redact_body: (_ToS text) -> String
18
18
 
19
- def log_redact: (_ToS text, bool should_redact) -> String
19
+ def log_redact: (_ToS text, ?bool? should_redact) -> String
20
20
  end
21
21
  end
data/sig/options.rbs CHANGED
@@ -17,6 +17,7 @@ module HTTPX
17
17
 
18
18
  DEFAULT_OPTIONS: Hash[Symbol, untyped]
19
19
  REQUEST_BODY_IVARS: Array[Symbol]
20
+ RESOLVER_IVARS: Array[Symbol]
20
21
  RESOLVER_TYPES: Array[Symbol]
21
22
  USER_AGENT: String
22
23
 
@@ -106,8 +107,10 @@ module HTTPX
106
107
 
107
108
  attr_reader ssl: Hash[Symbol, untyped]
108
109
 
109
- # io
110
- type io_option = _ToIO | Hash[String, _ToIO]
110
+ type external_io = TCPSocket | OpenSSL::SSL::SSLSocket | UNIXSocket
111
+
112
+ type io_option = external_io | Hash[String, external_io]
113
+
111
114
  attr_reader io: io_option?
112
115
 
113
116
  # fallback_protocol
@@ -142,7 +145,9 @@ module HTTPX
142
145
 
143
146
  def ==: (Options other) -> bool
144
147
 
145
- def options_equals?: (Options other, ?Array[Symbol] ignore_ivars) -> bool
148
+ def connection_options_match?: (Options other, ?Array[Symbol] ignore_ivars) -> bool
149
+
150
+ def resolver_options_match?: (Options other) -> bool
146
151
 
147
152
  def merge: (Object & _ToHash[Symbol, untyped] other) -> (instance | self)
148
153
 
data/sig/parser/http1.rbs CHANGED
@@ -23,7 +23,7 @@ module HTTPX
23
23
 
24
24
  @observer: _HTTP1Events
25
25
  @state: Symbol
26
- @buffer: String
26
+ @buffer: String | Transcoder::Chunker::Decoder
27
27
  @content_type: String?
28
28
  @content_length: Integer
29
29
  @_has_trailers: bool
@@ -9,7 +9,7 @@ module HTTPX
9
9
 
10
10
  private
11
11
 
12
- def initialize: (string user, string password, *untyped) -> void
12
+ def initialize: (string user, string password, **untyped) -> void
13
13
 
14
14
  end
15
15
  end
@@ -12,7 +12,7 @@ module HTTPX
12
12
 
13
13
  def can_authenticate?: (String? authenticate) -> boolish
14
14
 
15
- def authenticate: (Request request, String authenticate) -> String
15
+ def authenticate: (Request request, String authenticate) -> String?
16
16
 
17
17
  private
18
18
 
@@ -10,6 +10,8 @@ module HTTPX
10
10
 
11
11
  def authenticate: (Request request, String authenticate) -> String
12
12
 
13
+ def negotiate: () -> void
14
+
13
15
  private
14
16
 
15
17
  def initialize: (string user, string password, ?domain: String?) -> void
data/sig/plugins/auth.rbs CHANGED
@@ -10,7 +10,8 @@ module HTTPX
10
10
  end
11
11
 
12
12
  module InstanceMethods
13
- @auth_header_value: String
13
+ @auth_header_value: String?
14
+ @auth_header_value_mtx: Thread::Mutex
14
15
  @skip_auth_header_value: bool
15
16
 
16
17
  def authorization: (?string token, ?auth_header_type: string) ?{ (Request) -> string } -> instance
@@ -29,7 +30,9 @@ module HTTPX
29
30
  end
30
31
 
31
32
  module RequestMethods
32
- @auth_token_value: String?
33
+ attr_reader auth_token_value: String?
34
+
35
+ @auth_header_value: String?
33
36
 
34
37
  def authorized?: () -> bool
35
38
 
@@ -30,7 +30,7 @@ module HTTPX
30
30
  end
31
31
 
32
32
  module RequestMethods
33
- attr_accessor root_request: instance?
33
+ attr_accessor root_request: (Request & RequestMethods)?
34
34
 
35
35
  @redirect_request: redirect_request
36
36
 
@@ -24,6 +24,7 @@ module HTTPX
24
24
  attr_reader scheme: String?
25
25
  attr_reader no_proxy: Array[String]?
26
26
 
27
+ @ns: Integer
27
28
  @uris: Array[URI::Generic | String]
28
29
  @authenticator: _Authenticator
29
30
 
@@ -51,6 +51,8 @@ module HTTPX
51
51
  module ResponseMethods
52
52
  attr_writer original_request: cacheRequest
53
53
 
54
+ attr_writer revalidated_at: Time
55
+
54
56
  @cached: bool
55
57
  @cache_control: Array[String]?
56
58
  @vary: Array[String]?
@@ -47,7 +47,7 @@ module HTTPX
47
47
 
48
48
  def prepare_to_retry: (Request & RequestMethods request, retriesResponse response) -> void
49
49
 
50
- def when_to_retry: (Request & RequestMethods request, retriesResponse response, retriesOptions options) -> void
50
+ def when_to_retry: (Request & RequestMethods request, retriesResponse response, retriesOptions options) -> Numeric?
51
51
  end
52
52
 
53
53
  module RequestMethods
@@ -18,7 +18,7 @@ module HTTPX
18
18
 
19
19
  def initialize: (*_Tracer tracers) -> void
20
20
 
21
- def merge: (instance | _Tracer) -> void
21
+ def merge: (instance) -> void
22
22
  end
23
23
 
24
24
  interface _RetriesOptions
data/sig/pool.rbs CHANGED
@@ -34,7 +34,7 @@ module HTTPX
34
34
 
35
35
  def checkout_resolver: (Options options) -> resolver_manager
36
36
 
37
- def checkin_resolver: (Resolver::Resolver resolver) -> void
37
+ def checkin_resolver: (Resolver::Multi | Resolver::Resolver resolver) -> void
38
38
 
39
39
  private
40
40
 
data/sig/request.rbs CHANGED
@@ -18,6 +18,8 @@ module HTTPX
18
18
  attr_reader drain_error: StandardError?
19
19
  attr_reader active_timeouts: Array[Symbol]
20
20
 
21
+ attr_writer connection: Connection?
22
+ attr_writer on_response_arrived: (^() -> void)?
21
23
  attr_accessor peer_address: (String | IPAddr)?
22
24
 
23
25
  attr_writer persistent: bool
@@ -81,6 +83,10 @@ module HTTPX
81
83
 
82
84
  def set_timeout_callback: (Symbol event) { (*untyped) -> void } -> void
83
85
 
86
+ def handle_error: (StandardError error) -> void
87
+
88
+ def emit_response: (response response) -> void
89
+
84
90
  private
85
91
 
86
92
  def initialize_body: (Options options) -> Transcoder::_Encoder?
data/sig/session.rbs CHANGED
@@ -62,8 +62,6 @@ module HTTPX
62
62
 
63
63
  def send_requests: (*Request) -> Array[response]
64
64
 
65
- def _send_requests: (Array[Request] requests, Selector selector) -> void
66
-
67
65
  def receive_requests: (Array[Request] requests, Selector selector) -> Array[response]
68
66
 
69
67
  def early_resolve: (resolver resolver, Connection connection) -> bool
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.5
4
+ version: 1.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -165,6 +165,8 @@ extra_rdoc_files:
165
165
  - doc/release_notes/1_7_3.md
166
166
  - doc/release_notes/1_7_4.md
167
167
  - doc/release_notes/1_7_5.md
168
+ - doc/release_notes/1_7_6.md
169
+ - doc/release_notes/1_7_7.md
168
170
  files:
169
171
  - LICENSE.txt
170
172
  - README.md
@@ -302,6 +304,8 @@ files:
302
304
  - doc/release_notes/1_7_3.md
303
305
  - doc/release_notes/1_7_4.md
304
306
  - doc/release_notes/1_7_5.md
307
+ - doc/release_notes/1_7_6.md
308
+ - doc/release_notes/1_7_7.md
305
309
  - lib/httpx.rb
306
310
  - lib/httpx/adapters/datadog.rb
307
311
  - lib/httpx/adapters/faraday.rb