active_utils 3.3.18 → 3.3.19

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: ba20b023488f4b47c77a36833387c62951f0fcf50eab1a0fca623a745cf54d71
4
- data.tar.gz: 9d7de1684d1c17b84db39717bba46abc43a68589bda5bd7030245ca3dda14e01
3
+ metadata.gz: 3c236e83dc0c4b35da1b23d174deee446185fa5ba2eebd342bf28f329c33823d
4
+ data.tar.gz: 0cbc00453c11d9fde11335b86c62413d41bd4b29998922875a0c34de844e47c7
5
5
  SHA512:
6
- metadata.gz: adf0fe3ac25f1a6c5afbf4d893f8ff648b8b7dfc09b150e166b56d4d373b969c0fdd156ec28e8c3dffb6394e324a88184e9a3184dfa66baf014b2b331b51a5e6
7
- data.tar.gz: c7a6c626e7c3a3d24945bd4ceb8e2d64512ff30bdc60ede9466bc4c348d72974f93f10d05db136ec3502771ce413ca515eeb4f70bb7c8701e8c8352d228462ce
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
- CA_FILE = (File.dirname(__FILE__) + '/../certs/cacert.pem')
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 = nil
51
+ @proxy_address = PROXY_ADDRESS
49
52
  @proxy_port = nil
50
53
  end
51
54
 
@@ -24,6 +24,8 @@ module ActiveUtils #:nodoc:
24
24
  base.class_attribute :wiredump_device
25
25
 
26
26
  base.class_attribute :proxy_address
27
+ base.proxy_address = Connection::PROXY_ADDRESS
28
+
27
29
  base.class_attribute :proxy_port
28
30
  end
29
31
 
@@ -1,3 +1,3 @@
1
1
  module ActiveUtils
2
- VERSION = "3.3.18"
2
+ VERSION = "3.3.19"
3
3
  end
@@ -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.18
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-09-30 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport