apireaper 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c571ac7d1e7d82434492f7af4b46ce6eeb4462c0
4
- data.tar.gz: 5d512cfbad3fc231ba6ed5291bfc17ad5bbedd9e
3
+ metadata.gz: ab47e6b5bf430530f7e94bd73682f86226611039
4
+ data.tar.gz: d4bc3feb1794e57074d4e23abcc452809b96b9f0
5
5
  SHA512:
6
- metadata.gz: 83c3ff65efa2c8492699348d24426226f4844e014132eae9820bf12f9cc6aa23403d110ec3e27d034e4ef632e36d2c743ad6fdfe6f29dfd57056646a5531cfd8
7
- data.tar.gz: 5061d28640b107cf53a12e146a461737c3b24966634d7d5fd1ef21b820fa763d05049e1eca12f61773e3413d597a3590a4aef8dbec79d4042d8c13e5cd02895e
6
+ metadata.gz: 82dcde96d8839274c3517b2319ba94f1524dec8c78b02b10213fc87c1b103086eef9b4090d36bef23a1da5f27632a782123f905647a2d051ea13703f8e04126e
7
+ data.tar.gz: 95c9524edaac3e5d6784cef21d0b42619c18fffaf8dc391d7897d5345afdec4d4ef63d3d933e3b82bd9074c9e9434baada399337f44610d0a9af8fd563726535
data/CHANGELOG CHANGED
@@ -5,3 +5,19 @@ Changelog
5
5
  -----
6
6
 
7
7
  - Initial version
8
+
9
+ 1.0.11
10
+ ------
11
+
12
+ - Add GET method
13
+ - Add basic authentication parameters
14
+
15
+ 1.0.13
16
+ ------
17
+
18
+ - Change exit code to fit Nagios Convention
19
+
20
+ 1.0.14
21
+ ------
22
+
23
+ - Add insecure mode using SSL
@@ -67,6 +67,13 @@ module APIReaper
67
67
  aliases: ['-o'],
68
68
  desc: 'Write the response body to output file.'
69
69
  )
70
+ option(
71
+ :insecure,
72
+ aliases: ['-k'],
73
+ type: :boolean,
74
+ default: false,
75
+ desc: 'Do not verify certificates using SSL'
76
+ )
70
77
  option(
71
78
  :quiet,
72
79
  aliases: ['-q'],
@@ -29,6 +29,7 @@ module APIReaper
29
29
  @opts = opts
30
30
  @http = Net::HTTP.new(@uri.host, @uri.port)
31
31
  @http.use_ssl = @uri.scheme.eql?('https')
32
+ @http.verify_mode = OpenSSL::SSL::VERIFY_NONE if opts['insecure']
32
33
  end
33
34
 
34
35
  # Exit with the specified errno and message
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module APIReaper
19
- VERSION = '1.0.13'.freeze
19
+ VERSION = '1.0.14'.freeze
20
20
  end
@@ -87,4 +87,10 @@ describe APIReaper::Requester do # rubocop:disable Metrics/BlockLength
87
87
  expect { start(self) }.to raise_error(SystemExit)
88
88
  end
89
89
  end
90
+
91
+ context 'check get https://api.test.yueyehua.net/ -k' do
92
+ it 'requests an API via https using insecure mode.' do
93
+ expect { start(self) }.to output(print_out(200)).to_stdout
94
+ end
95
+ end
90
96
  end
@@ -60,5 +60,8 @@ RSpec.configure do |config| # rubocop:disable Metrics/BlockLength
60
60
  stub_request(:post, 'http://api.fail.yueyehua.net/')
61
61
  .with('body' => { 'l' => 'w' }, 'headers' => { 'l' => 'w' })
62
62
  .to_return('status' => 404, 'body' => '{}', 'headers' => {})
63
+ # requests an API via https using insecure mode
64
+ stub_request(:get, 'https://api.test.yueyehua.net/')
65
+ .to_return('status' => 200, 'body' => '{}', 'headers' => {})
63
66
  end
64
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apireaper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Delaplace
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-02 00:00:00.000000000 Z
11
+ date: 2018-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler