faraday 2.12.2 → 2.13.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1bb65eef3cffcd2819dea033cc2f596b7626b3a7d9b2b0acde0c58a7160cb1e
|
4
|
+
data.tar.gz: dd57fdb09a5aadb4689c2b20d65fada72ce224a14aa0d850a2916fd94f33c68d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b96592916479cb638749ebdbacc44b7a622fba818fdbd92de981d47133f9f721dbf44895e877f8f7769415450dfb9d039389abcd6ad367dd6d012b3dfd56ab0
|
7
|
+
data.tar.gz: 88bfc380df8d4e4454f40e29b245ccb6832860fac481645743e1543fb5bd9e057d19a0ff5a5679fcf58abfa7c50e50069afca7c2e352b08a7f1065a8239a0f6a
|
@@ -22,8 +22,10 @@ module Faraday
|
|
22
22
|
when URI
|
23
23
|
value = { uri: value }
|
24
24
|
when Hash, Options
|
25
|
-
if
|
26
|
-
value
|
25
|
+
if value[:uri]
|
26
|
+
value = value.dup.tap do |duped|
|
27
|
+
duped[:uri] = Utils.URI(duped[:uri])
|
28
|
+
end
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
@@ -11,6 +11,9 @@ module Faraday
|
|
11
11
|
# # @return [Boolean] whether to enable hostname verification on server certificates
|
12
12
|
# # during the handshake or not (see https://github.com/ruby/openssl/pull/60)
|
13
13
|
# #
|
14
|
+
# # @!attribute hostname
|
15
|
+
# # @return [String] Server hostname used for SNI (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLSocket.html#method-i-hostname-3D)
|
16
|
+
# #
|
14
17
|
# # @!attribute ca_file
|
15
18
|
# # @return [String] CA file
|
16
19
|
# #
|
@@ -50,7 +53,7 @@ module Faraday
|
|
50
53
|
# # @!attribute ciphers
|
51
54
|
# # @return [String] cipher list in OpenSSL format (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ciphers-3D)
|
52
55
|
# class SSLOptions < Options; end
|
53
|
-
SSLOptions = Options.new(:verify, :verify_hostname,
|
56
|
+
SSLOptions = Options.new(:verify, :verify_hostname, :hostname,
|
54
57
|
:ca_file, :ca_path, :verify_mode,
|
55
58
|
:cert_store, :client_cert, :client_key,
|
56
59
|
:certificate, :private_key, :verify_depth,
|
data/lib/faraday/rack_builder.rb
CHANGED
@@ -27,10 +27,11 @@ module Faraday
|
|
27
27
|
|
28
28
|
attr_reader :name
|
29
29
|
|
30
|
-
|
30
|
+
def initialize(klass, *args, **kwargs, &block)
|
31
31
|
@name = klass.to_s
|
32
32
|
REGISTRY.set(klass) if klass.respond_to?(:name)
|
33
33
|
@args = args
|
34
|
+
@kwargs = kwargs
|
34
35
|
@block = block
|
35
36
|
end
|
36
37
|
|
@@ -53,7 +54,7 @@ module Faraday
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def build(app = nil)
|
56
|
-
klass.new(app, *@args, &@block)
|
57
|
+
klass.new(app, *@args, **@kwargs, &@block)
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
@@ -106,11 +107,11 @@ module Faraday
|
|
106
107
|
use_symbol(Faraday::Response, ...)
|
107
108
|
end
|
108
109
|
|
109
|
-
|
110
|
+
def adapter(klass = NO_ARGUMENT, *args, **kwargs, &block)
|
110
111
|
return @adapter if klass == NO_ARGUMENT || klass.nil?
|
111
112
|
|
112
113
|
klass = Faraday::Adapter.lookup_middleware(klass) if klass.is_a?(Symbol)
|
113
|
-
@adapter = self.class::Handler.new(klass, *args, &block)
|
114
|
+
@adapter = self.class::Handler.new(klass, *args, **kwargs, &block)
|
114
115
|
end
|
115
116
|
|
116
117
|
## methods to push onto the various positions in the stack:
|
data/lib/faraday/version.rb
CHANGED
@@ -27,6 +27,33 @@ RSpec.describe Faraday::ProxyOptions do
|
|
27
27
|
expect(options.inspect).to eq('#<Faraday::ProxyOptions (empty)>')
|
28
28
|
end
|
29
29
|
|
30
|
+
it 'works with hash' do
|
31
|
+
hash = { user: 'user', password: 'pass', uri: 'http://@example.org' }
|
32
|
+
options = Faraday::ProxyOptions.from(hash)
|
33
|
+
expect(options.user).to eq('user')
|
34
|
+
expect(options.password).to eq('pass')
|
35
|
+
expect(options.uri).to be_a_kind_of(URI)
|
36
|
+
expect(options.path).to eq('')
|
37
|
+
expect(options.port).to eq(80)
|
38
|
+
expect(options.host).to eq('example.org')
|
39
|
+
expect(options.scheme).to eq('http')
|
40
|
+
expect(options.inspect).to match('#<Faraday::ProxyOptions uri=')
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'works with option' do
|
44
|
+
opt_arg = { user: 'user', password: 'pass', uri: 'http://@example.org' }
|
45
|
+
option = Faraday::ConnectionOptions.from(proxy: opt_arg)
|
46
|
+
options = Faraday::ProxyOptions.from(option.proxy)
|
47
|
+
expect(options.user).to eq('user')
|
48
|
+
expect(options.password).to eq('pass')
|
49
|
+
expect(options.uri).to be_a_kind_of(URI)
|
50
|
+
expect(options.path).to eq('')
|
51
|
+
expect(options.port).to eq(80)
|
52
|
+
expect(options.host).to eq('example.org')
|
53
|
+
expect(options.scheme).to eq('http')
|
54
|
+
expect(options.inspect).to match('#<Faraday::ProxyOptions uri=')
|
55
|
+
end
|
56
|
+
|
30
57
|
it 'works with no auth' do
|
31
58
|
proxy = Faraday::ProxyOptions.from 'http://example.org'
|
32
59
|
expect(proxy.user).to be_nil
|
data/spec/faraday/utils_spec.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@technoweenie"
|
8
8
|
- "@iMacTia"
|
9
9
|
- "@olleolleolle"
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: faraday-net_http
|
@@ -60,7 +59,6 @@ dependencies:
|
|
60
59
|
- - ">="
|
61
60
|
- !ruby/object:Gem::Version
|
62
61
|
version: '0'
|
63
|
-
description:
|
64
62
|
email: technoweenie@gmail.com
|
65
63
|
executables: []
|
66
64
|
extensions: []
|
@@ -146,11 +144,10 @@ licenses:
|
|
146
144
|
- MIT
|
147
145
|
metadata:
|
148
146
|
homepage_uri: https://lostisland.github.io/faraday
|
149
|
-
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.
|
147
|
+
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.13.0
|
150
148
|
source_code_uri: https://github.com/lostisland/faraday
|
151
149
|
bug_tracker_uri: https://github.com/lostisland/faraday/issues
|
152
150
|
rubygems_mfa_required: 'true'
|
153
|
-
post_install_message:
|
154
151
|
rdoc_options: []
|
155
152
|
require_paths:
|
156
153
|
- lib
|
@@ -166,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
163
|
- !ruby/object:Gem::Version
|
167
164
|
version: '0'
|
168
165
|
requirements: []
|
169
|
-
rubygems_version: 3.
|
170
|
-
signing_key:
|
166
|
+
rubygems_version: 3.6.2
|
171
167
|
specification_version: 4
|
172
168
|
summary: HTTP/REST API client library.
|
173
169
|
test_files: []
|