httpx 0.19.6 → 0.20.0

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes/0_19_7.md +5 -0
  3. data/doc/release_notes/0_19_8.md +5 -0
  4. data/doc/release_notes/0_20_0.md +36 -0
  5. data/lib/httpx/adapters/datadog.rb +112 -58
  6. data/lib/httpx/adapters/sentry.rb +102 -0
  7. data/lib/httpx/connection.rb +10 -2
  8. data/lib/httpx/io/ssl.rb +8 -3
  9. data/lib/httpx/options.rb +5 -0
  10. data/lib/httpx/plugins/authentication/basic.rb +24 -0
  11. data/lib/httpx/plugins/authentication/digest.rb +102 -0
  12. data/lib/httpx/plugins/authentication/ntlm.rb +37 -0
  13. data/lib/httpx/plugins/authentication/socks5.rb +24 -0
  14. data/lib/httpx/plugins/basic_authentication.rb +6 -6
  15. data/lib/httpx/plugins/digest_authentication.rb +15 -111
  16. data/lib/httpx/plugins/follow_redirects.rb +17 -5
  17. data/lib/httpx/plugins/ntlm_authentication.rb +8 -18
  18. data/lib/httpx/plugins/proxy/http.rb +76 -13
  19. data/lib/httpx/plugins/proxy/socks5.rb +6 -4
  20. data/lib/httpx/plugins/proxy.rb +35 -9
  21. data/lib/httpx/plugins/response_cache/store.rb +1 -0
  22. data/lib/httpx/request.rb +3 -1
  23. data/lib/httpx/session.rb +7 -2
  24. data/lib/httpx/version.rb +1 -1
  25. data/sig/chainable.rbs +4 -4
  26. data/sig/plugins/authentication/basic.rbs +19 -0
  27. data/sig/plugins/authentication/digest.rbs +24 -0
  28. data/sig/plugins/authentication/ntlm.rbs +20 -0
  29. data/sig/plugins/authentication/socks5.rbs +18 -0
  30. data/sig/plugins/basic_authentication.rbs +2 -2
  31. data/sig/plugins/digest_authentication.rbs +3 -13
  32. data/sig/plugins/ntlm_authentication.rbs +3 -8
  33. data/sig/plugins/proxy/http.rbs +13 -3
  34. data/sig/plugins/proxy.rbs +5 -3
  35. data/sig/session.rbs +1 -1
  36. metadata +17 -2
@@ -0,0 +1,24 @@
1
+ module HTTPX
2
+ module Plugins
3
+ module Authentication
4
+ class Digest
5
+ @user: String
6
+ @password: String
7
+
8
+ def can_authenticate?: (String? authenticate) -> boolish
9
+
10
+ def authenticate: (Request request, String authenticate) -> String
11
+
12
+ private
13
+
14
+ def generate_header: (String meth, String uri, String authenticate) -> String
15
+
16
+ def initialize: (string user, string password) -> void
17
+
18
+ def make_cnonce: () -> String
19
+
20
+ def next_nonce: () -> Integer
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ module HTTPX
2
+ module Plugins
3
+ module Authentication
4
+ class Ntlm
5
+ @user: String
6
+ @password: String
7
+ @domain: String?
8
+
9
+ def can_authenticate?: (String? authenticate) -> boolish
10
+
11
+ def authenticate: (Request request, String authenticate) -> String
12
+
13
+ private
14
+
15
+ def initialize: (string user, string password, ?domain: String?) -> void
16
+
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ module HTTPX
2
+ module Plugins
3
+ module Authentication
4
+ class Socks5
5
+ @user: String
6
+ @password: String
7
+
8
+ def can_authenticate?: (*untyped) -> boolish
9
+
10
+ def authenticate: (*untyped) -> String
11
+
12
+ private
13
+
14
+ def initialize: (string user, string password) -> void
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,6 +1,6 @@
1
1
  module HTTPX
2
2
  module Plugins
3
- module BasicAuthentication
3
+ module BasicAuth
4
4
  def self.load_dependencies: (singleton(Session)) -> void
5
5
 
6
6
  def self.configure: (singleton(Session)) -> void
@@ -10,6 +10,6 @@ module HTTPX
10
10
  end
11
11
  end
12
12
 
13
- type sessionBasicAuthentication = sessionAuthentication & Authentication::InstanceMethods & BasicAuthentication::InstanceMethods
13
+ type sessionBasicAuth = sessionAuthentication & Authentication::InstanceMethods & BasicAuth::InstanceMethods
14
14
  end
15
15
  end
@@ -1,10 +1,10 @@
1
1
  module HTTPX
2
2
  module Plugins
3
- module DigestAuthentication
3
+ module DigestAuth
4
4
  DigestError: singleton(Error)
5
5
 
6
6
  interface _DigestOptions
7
- def digest: () -> Digest?
7
+ def digest: () -> Authentication::Digest?
8
8
  end
9
9
 
10
10
  def self.extra_options: (Options) -> (Options & _DigestOptions)
@@ -14,18 +14,8 @@ module HTTPX
14
14
  module InstanceMethods
15
15
  def digest_authentication: (string user, string password) -> instance
16
16
  end
17
-
18
- class Digest
19
- def generate_header: (Request, Response, ?bool?) -> String
20
-
21
- private
22
-
23
- def initialize: (string user, string password) -> untyped
24
- def make_cnonce: () -> String
25
- def next_nonce: () -> Integer
26
- end
27
17
  end
28
18
 
29
- type sessionDigestAuthentication = sessionAuthentication & DigestAuthentication::InstanceMethods
19
+ type sessionDigestAuth = sessionAuthentication & DigestAuth::InstanceMethods
30
20
  end
31
21
  end
@@ -1,9 +1,9 @@
1
1
  module HTTPX
2
2
  module Plugins
3
- module NTLMAuthentication
3
+ module NTLMAuth
4
4
 
5
5
  interface _NTLMOptions
6
- def ntlm: () -> NTLMParams?
6
+ def ntlm: () -> Authentication::Ntlm?
7
7
  end
8
8
 
9
9
  def self.extra_options: (Options) -> (Options & _NTLMOptions)
@@ -14,13 +14,8 @@ module HTTPX
14
14
  def ntlm_authentication: (string user, string password, ?string? domain) -> instance
15
15
  end
16
16
 
17
- class NTLMParams
18
- attr_reader user: String
19
- attr_reader password: String
20
- attr_reader domain: String?
21
- end
22
17
  end
23
18
 
24
- type sessionNTLMAuthentication = sessionAuthentication & NTLMAuthentication::InstanceMethods
19
+ type sessionNTLMAuth = sessionAuthentication & NTLMAuth::InstanceMethods
25
20
  end
26
21
  end
@@ -2,13 +2,23 @@ module HTTPX
2
2
  module Plugins
3
3
  module Proxy
4
4
  module HTTP
5
-
5
+
6
+ module InstanceMethods
7
+ def with_proxy_basic_auth: (Hash[Symbol, untyped] opts) -> instance
8
+
9
+ def with_proxy_digest_auth: (Hash[Symbol, untyped] opts) -> instance
10
+
11
+ def with_proxy_ntlm_auth: (Hash[Symbol, untyped] opts) -> instance
12
+ end
13
+
6
14
  module ConnectionMethods
7
- def __http_proxy_connect: () -> void
15
+ def __http_proxy_connect: (Connection::_Parser parser) -> void
8
16
  def __http_on_connect: (top, Response) -> void
9
17
  end
10
-
18
+
11
19
  end
12
20
  end
21
+
22
+ type httpProxy = Session & Proxy::HTTP::InstanceMethods
13
23
  end
14
24
  end
@@ -11,15 +11,17 @@ module HTTPX
11
11
  attr_reader uri: URI::Generic
12
12
  attr_reader username: String?
13
13
  attr_reader password: String?
14
+ attr_reader scheme: String?
14
15
 
15
- def authenticated?: () -> boolish
16
- def token_authentication: () -> String?
16
+ def can_authenticate?: (*untyped) -> boolish
17
+
18
+ def authenticate: (*untyped) -> String?
17
19
 
18
20
  def ==: (untyped) -> bool
19
21
 
20
22
  private
21
23
 
22
- def initialize: (uri: generic_uri, ?username: String, ?password: String) -> untyped
24
+ def initialize: (uri: generic_uri, ?scheme: String, ?username: String, ?password: String, **extra) -> untyped
23
25
  end
24
26
 
25
27
  def self.configure: (singleton(Session)) -> void
data/sig/session.rbs CHANGED
@@ -33,7 +33,7 @@ module HTTPX
33
33
 
34
34
  def set_connection_callbacks: (Connection, Array[Connection], Options) -> void
35
35
 
36
- def build_altsvc_connection: (Connection, Array[Connection], URI::Generic, String, Hash[String, String], Options) -> Connection?
36
+ def build_altsvc_connection: (Connection existing_connection, Array[Connection] connections, URI::Generic alt_origin, String origin, Hash[String, String] alt_params, Options options) -> Connection?
37
37
 
38
38
  def build_requests: (verb | string, uri, options) -> Array[Request]
39
39
  | (Array[[verb | string, uri, options]], options) -> Array[Request]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.6
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-04 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2-next
@@ -77,7 +77,10 @@ extra_rdoc_files:
77
77
  - doc/release_notes/0_19_4.md
78
78
  - doc/release_notes/0_19_5.md
79
79
  - doc/release_notes/0_19_6.md
80
+ - doc/release_notes/0_19_7.md
81
+ - doc/release_notes/0_19_8.md
80
82
  - doc/release_notes/0_1_0.md
83
+ - doc/release_notes/0_20_0.md
81
84
  - doc/release_notes/0_2_0.md
82
85
  - doc/release_notes/0_2_1.md
83
86
  - doc/release_notes/0_3_0.md
@@ -147,7 +150,10 @@ files:
147
150
  - doc/release_notes/0_19_4.md
148
151
  - doc/release_notes/0_19_5.md
149
152
  - doc/release_notes/0_19_6.md
153
+ - doc/release_notes/0_19_7.md
154
+ - doc/release_notes/0_19_8.md
150
155
  - doc/release_notes/0_1_0.md
156
+ - doc/release_notes/0_20_0.md
151
157
  - doc/release_notes/0_2_0.md
152
158
  - doc/release_notes/0_2_1.md
153
159
  - doc/release_notes/0_3_0.md
@@ -172,6 +178,7 @@ files:
172
178
  - lib/httpx.rb
173
179
  - lib/httpx/adapters/datadog.rb
174
180
  - lib/httpx/adapters/faraday.rb
181
+ - lib/httpx/adapters/sentry.rb
175
182
  - lib/httpx/adapters/webmock.rb
176
183
  - lib/httpx/altsvc.rb
177
184
  - lib/httpx/buffer.rb
@@ -193,6 +200,10 @@ files:
193
200
  - lib/httpx/options.rb
194
201
  - lib/httpx/parser/http1.rb
195
202
  - lib/httpx/plugins/authentication.rb
203
+ - lib/httpx/plugins/authentication/basic.rb
204
+ - lib/httpx/plugins/authentication/digest.rb
205
+ - lib/httpx/plugins/authentication/ntlm.rb
206
+ - lib/httpx/plugins/authentication/socks5.rb
196
207
  - lib/httpx/plugins/aws_sdk_authentication.rb
197
208
  - lib/httpx/plugins/aws_sigv4.rb
198
209
  - lib/httpx/plugins/basic_authentication.rb
@@ -270,6 +281,10 @@ files:
270
281
  - sig/options.rbs
271
282
  - sig/parser/http1.rbs
272
283
  - sig/plugins/authentication.rbs
284
+ - sig/plugins/authentication/basic.rbs
285
+ - sig/plugins/authentication/digest.rbs
286
+ - sig/plugins/authentication/ntlm.rbs
287
+ - sig/plugins/authentication/socks5.rbs
273
288
  - sig/plugins/aws_sdk_authentication.rbs
274
289
  - sig/plugins/aws_sigv4.rbs
275
290
  - sig/plugins/basic_authentication.rbs