active_utils 3.3.18 → 3.3.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/active_utils/connection.rb +5 -2
- data/lib/active_utils/posts_data.rb +2 -0
- data/lib/active_utils/version.rb +1 -1
- data/test/unit/posts_data_test.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c236e83dc0c4b35da1b23d174deee446185fa5ba2eebd342bf28f329c33823d
|
4
|
+
data.tar.gz: 0cbc00453c11d9fde11335b86c62413d41bd4b29998922875a0c34de844e47c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8b71761d493d48d0a774bfaeab6d9ad06a608cc4188307070bcdba77ede74ff4ab16bac8a4bad04f29dc74280864034eaba9c1f3008b173ccb300a86a792ac8
|
7
|
+
data.tar.gz: d744cab2ae63bff0abcee7e4b1f627d87bc5836f9e8df7483d7b3da9e2693311177406bac67c4dc9399b045074baaa10325ae58f4c05ca817bc67b45d899fc4a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# ActiveUtils changelog
|
2
2
|
|
3
|
+
### Version 3.3.19 (February 24, 2020)
|
4
|
+
- Support `net/http` default proxy settings from `ENV['http_proxy']`
|
5
|
+
- Support usage of custom ssl certificate with `ENV['SSL_CERT_FILE']`, default variable for Ruby
|
6
|
+
|
3
7
|
### Version 3.3.17 (February 24, 2020)
|
4
8
|
- Add support for PATCH HTTP method in `ActiveUtils#Connection`
|
5
9
|
|
@@ -11,9 +11,12 @@ module ActiveUtils
|
|
11
11
|
OPEN_TIMEOUT = 60
|
12
12
|
READ_TIMEOUT = 60
|
13
13
|
VERIFY_PEER = true
|
14
|
-
|
14
|
+
# allow using proxy for https calls by pointing to it's certificate
|
15
|
+
# SSL_CERT_FILE is variable used by Ruby to look for certificate for net/http
|
16
|
+
CA_FILE = ENV.fetch('SSL_CERT_FILE', File.dirname(__FILE__) + '/../certs/cacert.pem')
|
15
17
|
CA_PATH = nil
|
16
18
|
RETRY_SAFE = false
|
19
|
+
PROXY_ADDRESS = :ENV
|
17
20
|
RUBY_184_POST_HEADERS = { "Content-Type" => "application/x-www-form-urlencoded" }
|
18
21
|
|
19
22
|
attr_accessor :endpoint
|
@@ -45,7 +48,7 @@ module ActiveUtils
|
|
45
48
|
@max_retries = MAX_RETRIES
|
46
49
|
@ignore_http_status = false
|
47
50
|
@ssl_version = nil
|
48
|
-
@proxy_address =
|
51
|
+
@proxy_address = PROXY_ADDRESS
|
49
52
|
@proxy_port = nil
|
50
53
|
end
|
51
54
|
|
data/lib/active_utils/version.rb
CHANGED
@@ -61,4 +61,13 @@ class PostsDataTest < Minitest::Test
|
|
61
61
|
assert_equal @poster.proxy_address, 'http://proxy.example.com'
|
62
62
|
assert_equal @poster.proxy_port, '8888'
|
63
63
|
end
|
64
|
+
|
65
|
+
class HttpConnectionAbort < StandardError; end
|
66
|
+
|
67
|
+
def test_respecting_environment_proxy_settings
|
68
|
+
Net::HTTP.stubs(:new).with('example.com', 80, :ENV, nil).raises(PostsDataTest::HttpConnectionAbort)
|
69
|
+
assert_raises(PostsDataTest::HttpConnectionAbort) do
|
70
|
+
@poster.ssl_post('http://example.com', '')
|
71
|
+
end
|
72
|
+
end
|
64
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|