Skip to content

Commit b9562bc

Browse files
committed
Bump to Faraday 2
Faraday 2 was released in early 2022. As part of this major release, authentication helper methods (such as basic_auth) were removed from the Connection object and into middleware. This commit updates vmfloaty's dependency on Faraday to ~> 2 and updates the Http class to use the new authentication middleware. This upgrade is helpful because, in a CI context, vmfloaty is often installed alongside other gems that use Faraday >= 2, and vmfloaty's current dependency on Faraday ~> 1.5, >= 1.5.1 can cause unexpected dependency resolution. You can read more about this unexpected dependency behavior in this GitHub issue: puppetlabs/orchestrator_client-ruby#41
1 parent 6b6d6f7 commit b9562bc

File tree

3 files changed

+53
-63
lines changed

3 files changed

+53
-63
lines changed

Gemfile.lock

Lines changed: 51 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,110 +3,100 @@ PATH
33
specs:
44
vmfloaty (1.8.1)
55
commander (>= 4.4.3, < 4.7.0)
6-
faraday (~> 1.5, >= 1.5.1)
6+
faraday (~> 2)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
addressable (2.8.6)
12-
public_suffix (>= 2.0.2, < 6.0)
13-
ast (2.4.2)
14-
bigdecimal (3.1.8)
11+
addressable (2.8.7)
12+
public_suffix (>= 2.0.2, < 7.0)
13+
ast (2.4.3)
14+
bigdecimal (3.3.1)
1515
coderay (1.1.3)
1616
commander (4.6.0)
1717
highline (~> 2.0.0)
18-
crack (1.0.0)
18+
crack (1.0.1)
1919
bigdecimal
2020
rexml
21-
diff-lcs (1.5.1)
22-
docile (1.4.0)
23-
faraday (1.10.3)
24-
faraday-em_http (~> 1.0)
25-
faraday-em_synchrony (~> 1.0)
26-
faraday-excon (~> 1.1)
27-
faraday-httpclient (~> 1.0)
28-
faraday-multipart (~> 1.0)
29-
faraday-net_http (~> 1.0)
30-
faraday-net_http_persistent (~> 1.0)
31-
faraday-patron (~> 1.0)
32-
faraday-rack (~> 1.0)
33-
faraday-retry (~> 1.0)
34-
ruby2_keywords (>= 0.0.4)
35-
faraday-em_http (1.0.0)
36-
faraday-em_synchrony (1.0.0)
37-
faraday-excon (1.1.0)
38-
faraday-httpclient (1.0.1)
39-
faraday-multipart (1.0.4)
40-
multipart-post (~> 2)
41-
faraday-net_http (1.0.1)
42-
faraday-net_http_persistent (1.2.0)
43-
faraday-patron (1.0.0)
44-
faraday-rack (1.0.0)
45-
faraday-retry (1.0.3)
46-
hashdiff (1.1.0)
21+
diff-lcs (1.6.2)
22+
docile (1.4.1)
23+
faraday (2.14.0)
24+
faraday-net_http (>= 2.0, < 3.5)
25+
json
26+
logger
27+
faraday-net_http (3.4.1)
28+
net-http (>= 0.5.0)
29+
hashdiff (1.2.1)
4730
highline (2.0.3)
48-
json (2.7.2)
49-
language_server-protocol (3.17.0.3)
50-
method_source (1.0.0)
51-
multipart-post (2.3.0)
52-
parallel (1.26.3)
53-
parser (3.3.5.0)
31+
json (2.15.2)
32+
language_server-protocol (3.17.0.5)
33+
lint_roller (1.1.0)
34+
logger (1.7.0)
35+
method_source (1.1.0)
36+
net-http (0.7.0)
37+
uri
38+
parallel (1.27.0)
39+
parser (3.3.10.0)
5440
ast (~> 2.4.1)
5541
racc
56-
pry (0.14.2)
42+
prism (1.6.0)
43+
pry (0.15.2)
5744
coderay (~> 1.1)
5845
method_source (~> 1.0)
59-
public_suffix (5.0.5)
46+
public_suffix (6.0.2)
6047
racc (1.8.1)
6148
rainbow (3.1.1)
62-
rake (13.2.1)
49+
rake (13.3.1)
6350
rb-readline (0.5.5)
64-
regexp_parser (2.9.2)
65-
rexml (3.3.6)
66-
strscan
67-
rspec (3.13.0)
51+
regexp_parser (2.11.3)
52+
rexml (3.4.4)
53+
rspec (3.13.2)
6854
rspec-core (~> 3.13.0)
6955
rspec-expectations (~> 3.13.0)
7056
rspec-mocks (~> 3.13.0)
71-
rspec-core (3.13.0)
57+
rspec-core (3.13.6)
7258
rspec-support (~> 3.13.0)
73-
rspec-expectations (3.13.0)
59+
rspec-expectations (3.13.5)
7460
diff-lcs (>= 1.2.0, < 2.0)
7561
rspec-support (~> 3.13.0)
76-
rspec-mocks (3.13.0)
62+
rspec-mocks (3.13.7)
7763
diff-lcs (>= 1.2.0, < 2.0)
7864
rspec-support (~> 3.13.0)
79-
rspec-support (3.13.0)
80-
rubocop (1.66.1)
65+
rspec-support (3.13.6)
66+
rubocop (1.81.7)
8167
json (~> 2.3)
82-
language_server-protocol (>= 3.17.0)
68+
language_server-protocol (~> 3.17.0.2)
69+
lint_roller (~> 1.1.0)
8370
parallel (~> 1.10)
8471
parser (>= 3.3.0.2)
8572
rainbow (>= 2.2.2, < 4.0)
86-
regexp_parser (>= 2.4, < 3.0)
87-
rubocop-ast (>= 1.32.2, < 2.0)
73+
regexp_parser (>= 2.9.3, < 3.0)
74+
rubocop-ast (>= 1.47.1, < 2.0)
8875
ruby-progressbar (~> 1.7)
89-
unicode-display_width (>= 2.4.0, < 3.0)
90-
rubocop-ast (1.32.3)
91-
parser (>= 3.3.1.0)
76+
unicode-display_width (>= 2.4.0, < 4.0)
77+
rubocop-ast (1.47.1)
78+
parser (>= 3.3.7.2)
79+
prism (~> 1.4)
9280
ruby-progressbar (1.13.0)
93-
ruby2_keywords (0.0.5)
9481
simplecov (0.22.0)
9582
docile (~> 1.1)
9683
simplecov-html (~> 0.11)
9784
simplecov_json_formatter (~> 0.1)
98-
simplecov-html (0.13.1)
85+
simplecov-html (0.13.2)
9986
simplecov-lcov (0.8.0)
10087
simplecov_json_formatter (0.1.4)
101-
strscan (3.1.0)
102-
unicode-display_width (2.5.0)
103-
webmock (3.23.1)
88+
unicode-display_width (3.2.0)
89+
unicode-emoji (~> 4.1)
90+
unicode-emoji (4.1.0)
91+
uri (1.1.0)
92+
webmock (3.26.1)
10493
addressable (>= 2.8.0)
10594
crack (>= 0.3.2)
10695
hashdiff (>= 0.4.0, < 2.0.0)
10796

10897
PLATFORMS
10998
aarch64-linux
99+
arm64-darwin-24
110100
x86_64-linux
111101

112102
DEPENDENCIES

lib/vmfloaty/http.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def self.get_conn_with_auth(verbose, url, user, password)
3737

3838
Faraday.new(url: url, ssl: { verify: false }) do |faraday|
3939
faraday.request :url_encoded
40-
faraday.request :basic_auth, user, password
40+
faraday.request :authorization, :basic, user, password
4141
faraday.response :logger if verbose
4242
faraday.adapter Faraday.default_adapter
4343
end

vmfloaty.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Gem::Specification.new do |s|
2222
s.require_path = 'lib'
2323

2424
s.add_dependency 'commander', '>= 4.4.3', '< 4.7.0'
25-
s.add_dependency 'faraday', '~> 1.5', '>= 1.5.1'
25+
s.add_dependency 'faraday', '~> 2'
2626
end

0 commit comments

Comments
 (0)