httpx 0.19.8 → 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.
- checksums.yaml +4 -4
- data/doc/release_notes/0_20_0.md +36 -0
- data/lib/httpx/adapters/sentry.rb +102 -0
- data/lib/httpx/connection.rb +10 -2
- data/lib/httpx/io/ssl.rb +8 -3
- data/lib/httpx/options.rb +5 -0
- data/lib/httpx/plugins/authentication/basic.rb +24 -0
- data/lib/httpx/plugins/authentication/digest.rb +102 -0
- data/lib/httpx/plugins/authentication/ntlm.rb +37 -0
- data/lib/httpx/plugins/authentication/socks5.rb +24 -0
- data/lib/httpx/plugins/basic_authentication.rb +6 -6
- data/lib/httpx/plugins/digest_authentication.rb +15 -111
- data/lib/httpx/plugins/follow_redirects.rb +17 -5
- data/lib/httpx/plugins/ntlm_authentication.rb +8 -18
- data/lib/httpx/plugins/proxy/http.rb +76 -13
- data/lib/httpx/plugins/proxy/socks5.rb +6 -4
- data/lib/httpx/plugins/proxy.rb +30 -8
- data/lib/httpx/plugins/response_cache/store.rb +1 -0
- data/lib/httpx/request.rb +3 -1
- data/lib/httpx/session.rb +7 -2
- data/lib/httpx/version.rb +1 -1
- data/sig/chainable.rbs +4 -4
- data/sig/plugins/authentication/basic.rbs +19 -0
- data/sig/plugins/authentication/digest.rbs +24 -0
- data/sig/plugins/authentication/ntlm.rbs +20 -0
- data/sig/plugins/authentication/socks5.rbs +18 -0
- data/sig/plugins/basic_authentication.rbs +2 -2
- data/sig/plugins/digest_authentication.rbs +3 -13
- data/sig/plugins/ntlm_authentication.rbs +3 -8
- data/sig/plugins/proxy/http.rbs +13 -3
- data/sig/plugins/proxy.rbs +5 -3
- data/sig/session.rbs +1 -1
- metadata +13 -2
@@ -5,13 +5,10 @@ module HTTPX
|
|
5
5
|
#
|
6
6
|
# https://gitlab.com/honeyryderchuck/httpx/wikis/Authentication#ntlm-authentication
|
7
7
|
#
|
8
|
-
module
|
9
|
-
NTLMParams = Struct.new(:user, :domain, :password)
|
10
|
-
|
8
|
+
module NTLMAuth
|
11
9
|
class << self
|
12
10
|
def load_dependencies(_klass)
|
13
|
-
|
14
|
-
require "ntlm"
|
11
|
+
require_relative "authentication/ntlm"
|
15
12
|
end
|
16
13
|
|
17
14
|
def extra_options(options)
|
@@ -21,7 +18,7 @@ module HTTPX
|
|
21
18
|
|
22
19
|
module OptionsMethods
|
23
20
|
def option_ntlm(value)
|
24
|
-
raise TypeError, ":ntlm must be a #{
|
21
|
+
raise TypeError, ":ntlm must be a #{Authentication::Ntlm}" unless value.is_a?(Authentication::Ntlm)
|
25
22
|
|
26
23
|
value
|
27
24
|
end
|
@@ -29,7 +26,7 @@ module HTTPX
|
|
29
26
|
|
30
27
|
module InstanceMethods
|
31
28
|
def ntlm_authentication(user, password, domain = nil)
|
32
|
-
with(ntlm:
|
29
|
+
with(ntlm: Authentication::Ntlm.new(user, password, domain: domain))
|
33
30
|
end
|
34
31
|
|
35
32
|
alias_method :ntlm_auth, :ntlm_authentication
|
@@ -39,19 +36,12 @@ module HTTPX
|
|
39
36
|
ntlm = request.options.ntlm
|
40
37
|
|
41
38
|
if ntlm
|
42
|
-
request.headers["authorization"] =
|
39
|
+
request.headers["authorization"] = ntlm.negotiate
|
43
40
|
probe_response = wrap { super(request).first }
|
44
41
|
|
45
|
-
if
|
46
|
-
probe_response.headers.key?("www-authenticate") &&
|
47
|
-
(challenge = probe_response.headers["www-authenticate"][/NTLM (.*)/, 1])
|
48
|
-
|
49
|
-
challenge = Base64.decode64(challenge)
|
50
|
-
ntlm_challenge = NTLM.authenticate(challenge, ntlm.user, ntlm.domain, ntlm.password).to_base64
|
51
|
-
|
42
|
+
if probe_response.status == 401 && ntlm.can_authenticate?(probe_response.headers["www-authenticate"])
|
52
43
|
request.transition(:idle)
|
53
|
-
|
54
|
-
request.headers["authorization"] = "NTLM #{ntlm_challenge}"
|
44
|
+
request.headers["authorization"] = ntlm.authenticate(request, probe_response.headers["www-authenticate"])
|
55
45
|
super(request)
|
56
46
|
else
|
57
47
|
probe_response
|
@@ -63,6 +53,6 @@ module HTTPX
|
|
63
53
|
end
|
64
54
|
end
|
65
55
|
end
|
66
|
-
register_plugin :ntlm_authentication,
|
56
|
+
register_plugin :ntlm_authentication, NTLMAuth
|
67
57
|
end
|
68
58
|
end
|
@@ -6,6 +6,42 @@ module HTTPX
|
|
6
6
|
module Plugins
|
7
7
|
module Proxy
|
8
8
|
module HTTP
|
9
|
+
module InstanceMethods
|
10
|
+
def with_proxy_basic_auth(opts)
|
11
|
+
with(proxy: opts.merge(scheme: "basic"))
|
12
|
+
end
|
13
|
+
|
14
|
+
def with_proxy_digest_auth(opts)
|
15
|
+
with(proxy: opts.merge(scheme: "digest"))
|
16
|
+
end
|
17
|
+
|
18
|
+
def with_proxy_ntlm_auth(opts)
|
19
|
+
with(proxy: opts.merge(scheme: "ntlm"))
|
20
|
+
end
|
21
|
+
|
22
|
+
def fetch_response(request, connections, options)
|
23
|
+
response = super
|
24
|
+
|
25
|
+
if response &&
|
26
|
+
response.status == 407 &&
|
27
|
+
!request.headers.key?("proxy-authorization") &&
|
28
|
+
response.headers.key?("proxy-authenticate")
|
29
|
+
|
30
|
+
connection = find_connection(request, connections, options)
|
31
|
+
|
32
|
+
if connection.options.proxy.can_authenticate?(response.headers["proxy-authenticate"])
|
33
|
+
request.transition(:idle)
|
34
|
+
request.headers["proxy-authorization"] =
|
35
|
+
connection.options.proxy.authenticate(request, response.headers["proxy-authenticate"])
|
36
|
+
connection.send(request)
|
37
|
+
return
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
response
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
9
45
|
module ConnectionMethods
|
10
46
|
def connecting?
|
11
47
|
super || @state == :connecting || @state == :connected
|
@@ -23,11 +59,27 @@ module HTTPX
|
|
23
59
|
@io.connect
|
24
60
|
return unless @io.connected?
|
25
61
|
|
26
|
-
@parser
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
62
|
+
@parser || begin
|
63
|
+
@parser = registry(@io.protocol).new(@write_buffer, @options.merge(max_concurrent_requests: 1))
|
64
|
+
parser = @parser
|
65
|
+
parser.extend(ProxyParser)
|
66
|
+
parser.on(:response, &method(:__http_on_connect))
|
67
|
+
parser.on(:close) { transition(:closing) }
|
68
|
+
parser.on(:reset) do
|
69
|
+
if parser.empty?
|
70
|
+
reset
|
71
|
+
else
|
72
|
+
transition(:closing)
|
73
|
+
transition(:closed)
|
74
|
+
emit(:reset)
|
75
|
+
|
76
|
+
parser.reset if @parser
|
77
|
+
transition(:idle)
|
78
|
+
transition(:connecting)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
__http_proxy_connect(parser)
|
82
|
+
end
|
31
83
|
return if @state == :connected
|
32
84
|
when :connected
|
33
85
|
return unless @state == :idle || @state == :connecting
|
@@ -44,13 +96,13 @@ module HTTPX
|
|
44
96
|
super
|
45
97
|
end
|
46
98
|
|
47
|
-
def __http_proxy_connect
|
99
|
+
def __http_proxy_connect(parser)
|
48
100
|
req = @pending.first
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
101
|
+
if req && req.uri.scheme == "https"
|
102
|
+
# if the first request after CONNECT is to an https address, it is assumed that
|
103
|
+
# all requests in the queue are not only ALL HTTPS, but they also share the certificate,
|
104
|
+
# and therefore, will share the connection.
|
105
|
+
#
|
54
106
|
connect_request = ConnectRequest.new(req.uri, @options)
|
55
107
|
@inflight += 1
|
56
108
|
parser.send(connect_request)
|
@@ -59,7 +111,7 @@ module HTTPX
|
|
59
111
|
end
|
60
112
|
end
|
61
113
|
|
62
|
-
def __http_on_connect(
|
114
|
+
def __http_on_connect(request, response)
|
63
115
|
@inflight -= 1
|
64
116
|
if response.status == 200
|
65
117
|
req = @pending.first
|
@@ -67,6 +119,14 @@ module HTTPX
|
|
67
119
|
@io = ProxySSL.new(@io, request_uri, @options)
|
68
120
|
transition(:connected)
|
69
121
|
throw(:called)
|
122
|
+
elsif response.status == 407 &&
|
123
|
+
!request.headers.key?("proxy-authorization") &&
|
124
|
+
@options.proxy.can_authenticate?(response.headers["proxy-authenticate"])
|
125
|
+
|
126
|
+
request.transition(:idle)
|
127
|
+
request.headers["proxy-authorization"] = @options.proxy.authenticate(request, response.headers["proxy-authenticate"])
|
128
|
+
@parser.send(request)
|
129
|
+
@inflight += 1
|
70
130
|
else
|
71
131
|
pending = @pending + @parser.pending
|
72
132
|
while (req = pending.shift)
|
@@ -88,7 +148,10 @@ module HTTPX
|
|
88
148
|
extra_headers = super
|
89
149
|
|
90
150
|
proxy_params = @options.proxy
|
91
|
-
|
151
|
+
if proxy_params.scheme == "basic"
|
152
|
+
# opt for basic auth
|
153
|
+
extra_headers["proxy-authorization"] = proxy_params.authenticate(extra_headers)
|
154
|
+
end
|
92
155
|
extra_headers["proxy-connection"] = extra_headers.delete("connection") if extra_headers.key?("connection")
|
93
156
|
extra_headers
|
94
157
|
end
|
@@ -18,6 +18,10 @@ module HTTPX
|
|
18
18
|
|
19
19
|
Error = Socks5Error
|
20
20
|
|
21
|
+
def self.load_dependencies(*)
|
22
|
+
require_relative "../authentication/socks5"
|
23
|
+
end
|
24
|
+
|
21
25
|
module ConnectionMethods
|
22
26
|
def call
|
23
27
|
super
|
@@ -156,16 +160,14 @@ module HTTPX
|
|
156
160
|
|
157
161
|
def negotiate(parameters)
|
158
162
|
methods = [NOAUTH]
|
159
|
-
methods << PASSWD if parameters.
|
163
|
+
methods << PASSWD if parameters.can_authenticate?
|
160
164
|
methods.unshift(methods.size)
|
161
165
|
methods.unshift(VERSION)
|
162
166
|
methods.pack("C*")
|
163
167
|
end
|
164
168
|
|
165
169
|
def authenticate(parameters)
|
166
|
-
|
167
|
-
password = parameters.password
|
168
|
-
[0x01, user.bytesize, user, password.bytesize, password].pack("CCA*CA*")
|
170
|
+
parameters.authenticate
|
169
171
|
end
|
170
172
|
|
171
173
|
def connect(uri)
|
data/lib/httpx/plugins/proxy.rb
CHANGED
@@ -19,22 +19,43 @@ module HTTPX
|
|
19
19
|
PROXY_ERRORS = [TimeoutError, IOError, SystemCallError, Error].freeze
|
20
20
|
|
21
21
|
class Parameters
|
22
|
-
attr_reader :uri, :username, :password
|
22
|
+
attr_reader :uri, :username, :password, :scheme
|
23
23
|
|
24
|
-
def initialize(uri:, username: nil, password: nil)
|
24
|
+
def initialize(uri:, scheme: nil, username: nil, password: nil, **extra)
|
25
25
|
@uri = uri.is_a?(URI::Generic) ? uri : URI(uri)
|
26
26
|
@username = username || @uri.user
|
27
27
|
@password = password || @uri.password
|
28
|
+
|
29
|
+
return unless @username && @password
|
30
|
+
|
31
|
+
scheme ||= case @uri.scheme
|
32
|
+
when "socks5"
|
33
|
+
@uri.scheme
|
34
|
+
when "http", "https"
|
35
|
+
"basic"
|
36
|
+
else
|
37
|
+
return
|
38
|
+
end
|
39
|
+
|
40
|
+
@scheme = scheme
|
41
|
+
|
42
|
+
auth_scheme = scheme.to_s.capitalize
|
43
|
+
|
44
|
+
require_relative "authentication/#{scheme}" unless defined?(Authentication) && Authentication.const_defined?(auth_scheme, false)
|
45
|
+
|
46
|
+
@authenticator = Authentication.const_get(auth_scheme).new(@username, @password, **extra)
|
28
47
|
end
|
29
48
|
|
30
|
-
def
|
31
|
-
|
49
|
+
def can_authenticate?(*args)
|
50
|
+
return false unless @authenticator
|
51
|
+
|
52
|
+
@authenticator.can_authenticate?(*args)
|
32
53
|
end
|
33
54
|
|
34
|
-
def
|
35
|
-
return unless
|
55
|
+
def authenticate(*args)
|
56
|
+
return unless @authenticator
|
36
57
|
|
37
|
-
|
58
|
+
@authenticator.authenticate(*args)
|
38
59
|
end
|
39
60
|
|
40
61
|
def ==(other)
|
@@ -42,7 +63,8 @@ module HTTPX
|
|
42
63
|
when Parameters
|
43
64
|
@uri == other.uri &&
|
44
65
|
@username == other.username &&
|
45
|
-
@password == other.password
|
66
|
+
@password == other.password &&
|
67
|
+
@scheme == other.scheme
|
46
68
|
when URI::Generic, String
|
47
69
|
proxy_uri = @uri.dup
|
48
70
|
proxy_uri.user = @username
|
@@ -37,6 +37,7 @@ module HTTPX::Plugins
|
|
37
37
|
return unless request.headers.same_headers?(original_request.headers)
|
38
38
|
else
|
39
39
|
return unless vary.split(/ *, */).all? do |cache_field|
|
40
|
+
cache_field.downcase!
|
40
41
|
!original_request.headers.key?(cache_field) || request.headers[cache_field] == original_request.headers[cache_field]
|
41
42
|
end
|
42
43
|
end
|
data/lib/httpx/request.rb
CHANGED
@@ -49,7 +49,9 @@ module HTTPX
|
|
49
49
|
origin = @options.origin
|
50
50
|
raise(Error, "invalid URI: #{@uri}") unless origin
|
51
51
|
|
52
|
-
|
52
|
+
base_path = @options.base_path
|
53
|
+
|
54
|
+
@uri = origin.merge("#{base_path}#{@uri}")
|
53
55
|
end
|
54
56
|
|
55
57
|
raise(Error, "unknown method: #{verb}") unless METHODS.include?(@verb)
|
data/lib/httpx/session.rb
CHANGED
@@ -106,16 +106,21 @@ module HTTPX
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def build_altsvc_connection(existing_connection, connections, alt_origin, origin, alt_params, options)
|
109
|
+
# do not allow security downgrades on altsvc negotiation
|
110
|
+
return if existing_connection.origin.scheme == "https" && alt_origin.scheme != "https"
|
111
|
+
|
109
112
|
altsvc = AltSvc.cached_altsvc_set(origin, alt_params.merge("origin" => alt_origin))
|
110
113
|
|
111
114
|
# altsvc already exists, somehow it wasn't advertised, probably noop
|
112
115
|
return unless altsvc
|
113
116
|
|
114
|
-
|
117
|
+
alt_options = options.merge(ssl: options.ssl.merge(hostname: URI(origin).host))
|
118
|
+
|
119
|
+
connection = pool.find_connection(alt_origin, alt_options) || build_connection(alt_origin, alt_options)
|
115
120
|
# advertised altsvc is the same origin being used, ignore
|
116
121
|
return if connection == existing_connection
|
117
122
|
|
118
|
-
set_connection_callbacks(connection, connections,
|
123
|
+
set_connection_callbacks(connection, connections, alt_options)
|
119
124
|
|
120
125
|
log(level: 1) { "#{origin} alt-svc: #{alt_origin}" }
|
121
126
|
|
data/lib/httpx/version.rb
CHANGED
data/sig/chainable.rbs
CHANGED
@@ -13,9 +13,9 @@ module HTTPX
|
|
13
13
|
| (options) { (Session) -> void } -> void
|
14
14
|
|
15
15
|
def plugin: (:authentication, ?options) -> Plugins::sessionAuthentication
|
16
|
-
| (:basic_authentication, ?options) -> Plugins::
|
17
|
-
| (:digest_authentication, ?options) -> Plugins::
|
18
|
-
| (:ntlm_authentication, ?options) -> Plugins::
|
16
|
+
| (:basic_authentication, ?options) -> Plugins::sessionBasicAuth
|
17
|
+
| (:digest_authentication, ?options) -> Plugins::sessionDigestAuth
|
18
|
+
| (:ntlm_authentication, ?options) -> Plugins::sessionNTLMAuth
|
19
19
|
| (:aws_sdk_authentication, ?options) -> Plugins::sessionAwsSdkAuthentication
|
20
20
|
| (:compression, ?options) -> Session
|
21
21
|
| (:cookies, ?options) -> Plugins::sessionCookies
|
@@ -25,7 +25,7 @@ module HTTPX
|
|
25
25
|
| (:h2c, ?options) -> Session
|
26
26
|
| (:multipart, ?options) -> Session
|
27
27
|
| (:persistent, ?options) -> Plugins::sessionPersistent
|
28
|
-
| (:proxy, ?options) -> Plugins::sessionProxy
|
28
|
+
| (:proxy, ?options) -> (Plugins::sessionProxy & Plugins::httpProxy)
|
29
29
|
| (:push_promise, ?options) -> Plugins::sessionPushPromise
|
30
30
|
| (:retries, ?options) -> Plugins::sessionRetries
|
31
31
|
| (:rate_limiter, ?options) -> Session
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module HTTPX
|
2
|
+
module Plugins
|
3
|
+
module Authentication
|
4
|
+
class Basic
|
5
|
+
@user: String
|
6
|
+
@password: String
|
7
|
+
|
8
|
+
def can_authenticate?: (String? authenticate) -> boolish
|
9
|
+
|
10
|
+
def authenticate: (*untyped) -> String
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def initialize: (string user, string password, *untyped) -> void
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -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
|
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
|
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
|
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
|
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
|
3
|
+
module NTLMAuth
|
4
4
|
|
5
5
|
interface _NTLMOptions
|
6
|
-
def ntlm: () ->
|
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
|
19
|
+
type sessionNTLMAuth = sessionAuthentication & NTLMAuth::InstanceMethods
|
25
20
|
end
|
26
21
|
end
|
data/sig/plugins/proxy/http.rbs
CHANGED
@@ -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
|
data/sig/plugins/proxy.rbs
CHANGED
@@ -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
|
16
|
-
|
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.
|
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-05-
|
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
|
@@ -80,6 +80,7 @@ extra_rdoc_files:
|
|
80
80
|
- doc/release_notes/0_19_7.md
|
81
81
|
- doc/release_notes/0_19_8.md
|
82
82
|
- doc/release_notes/0_1_0.md
|
83
|
+
- doc/release_notes/0_20_0.md
|
83
84
|
- doc/release_notes/0_2_0.md
|
84
85
|
- doc/release_notes/0_2_1.md
|
85
86
|
- doc/release_notes/0_3_0.md
|
@@ -152,6 +153,7 @@ files:
|
|
152
153
|
- doc/release_notes/0_19_7.md
|
153
154
|
- doc/release_notes/0_19_8.md
|
154
155
|
- doc/release_notes/0_1_0.md
|
156
|
+
- doc/release_notes/0_20_0.md
|
155
157
|
- doc/release_notes/0_2_0.md
|
156
158
|
- doc/release_notes/0_2_1.md
|
157
159
|
- doc/release_notes/0_3_0.md
|
@@ -176,6 +178,7 @@ files:
|
|
176
178
|
- lib/httpx.rb
|
177
179
|
- lib/httpx/adapters/datadog.rb
|
178
180
|
- lib/httpx/adapters/faraday.rb
|
181
|
+
- lib/httpx/adapters/sentry.rb
|
179
182
|
- lib/httpx/adapters/webmock.rb
|
180
183
|
- lib/httpx/altsvc.rb
|
181
184
|
- lib/httpx/buffer.rb
|
@@ -197,6 +200,10 @@ files:
|
|
197
200
|
- lib/httpx/options.rb
|
198
201
|
- lib/httpx/parser/http1.rb
|
199
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
|
200
207
|
- lib/httpx/plugins/aws_sdk_authentication.rb
|
201
208
|
- lib/httpx/plugins/aws_sigv4.rb
|
202
209
|
- lib/httpx/plugins/basic_authentication.rb
|
@@ -274,6 +281,10 @@ files:
|
|
274
281
|
- sig/options.rbs
|
275
282
|
- sig/parser/http1.rbs
|
276
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
|
277
288
|
- sig/plugins/aws_sdk_authentication.rbs
|
278
289
|
- sig/plugins/aws_sigv4.rbs
|
279
290
|
- sig/plugins/basic_authentication.rbs
|