brightbox-cli 3.0.1 → 3.1.0

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
  SHA256:
3
- metadata.gz: 1cc8d372e2c0c019461ab6f5302f71d9a5241646d57cc91eaba2be3033794012
4
- data.tar.gz: 95314299e02e4d28ea02467a00eb5093f7e74c9dbc561459ea892175edc08043
3
+ metadata.gz: c00fe9b9159d0df304bc91413fe0110a76efda76cf0685af77a5cf49506b43fa
4
+ data.tar.gz: a6484bd3ac805cad060686e19434f0a962c28fad1c2676df2c745f1d940abd0f
5
5
  SHA512:
6
- metadata.gz: e32fdba2d13ad2917a7200f5cba06223ec2fcf059dc3404685b790f81b64c009857e7f984e9c9a7e01f06d55db31f00820413c77ff1570ed5a934c78cc9c03a2
7
- data.tar.gz: 1d7c5414f09b8b1ffba4a3a00792dacb5555b0b2da38da9044591d8ab6ddbcc36dcb7a35e700ad61a839f414f26f9b7d5fe04210221438e82b864eb5a607a3cc
6
+ metadata.gz: fc691b5fabc3fb9191ec9e8518161d30ed2c8d88b2a291f83482f174be65aee5d1fe304dc2437e8fafc94cb5df5b18e9967d871704c6c24546d30b2b212bff61
7
+ data.tar.gz: ef35d51c5ff89422276886fbcd5a31c71131997433a06701e79bbc2c7f448ec203e5ada7887fa57370f1697aee79c89f11d155adc784e334e47ad6351ece5c32
@@ -1,3 +1,13 @@
1
+ ### v3.1.0 / 2020-11-17
2
+
3
+ [Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v3.0.1...v3.1.0)
4
+
5
+ Changes:
6
+
7
+ * Update `fog-brightbox` to v1.2.0
8
+ * Add `lbs` option for `--min-ssl-ver` to specify the minimum TLS/SSL protocol
9
+ that should be acceptable for use with the load balancer
10
+
1
11
  ### v3.0.1 / 2020-07-01
2
12
 
3
13
  [Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v3.0.0...v3.0.1)
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brightbox-cli (3.0.1)
4
+ brightbox-cli (3.1.0)
5
5
  dry-inflector (< 0.2)
6
- fog-brightbox (>= 1.1.0)
6
+ fog-brightbox (>= 1.2.0)
7
7
  fog-core (< 2.0)
8
8
  gli (~> 2.12.0)
9
9
  highline (~> 1.6.0)
@@ -22,8 +22,8 @@ GEM
22
22
  safe_yaml (~> 1.0.0)
23
23
  diff-lcs (1.4.3)
24
24
  dry-inflector (0.1.2)
25
- excon (0.75.0)
26
- fog-brightbox (1.1.0)
25
+ excon (0.78.0)
26
+ fog-brightbox (1.2.0)
27
27
  dry-inflector
28
28
  fog-core (>= 1.45, < 3.0)
29
29
  fog-json
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
22
22
  s.require_paths = ["lib"]
23
23
 
24
- s.add_dependency "fog-brightbox", ">= 1.1.0"
24
+ s.add_dependency "fog-brightbox", ">= 1.2.0"
25
25
  s.add_dependency "fog-core", "< 2.0"
26
26
  s.add_dependency "gli", "~> 2.12.0"
27
27
  s.add_dependency "i18n", "~> 0.6.0"
@@ -52,6 +52,10 @@ module Brightbox
52
52
  c.desc "Filepath to the private key used to sign SSL certificate (OpenSSL supported formats)."
53
53
  c.flag ["ssl-key"]
54
54
 
55
+ c.desc "Sets the minimum version of TLS/SSL to support in the format 'TLSv1.x'"
56
+ c.default_value "TLSv1.2"
57
+ c.flag ["ssl-min-ver"]
58
+
55
59
  c.desc "Enable SSL v3 support"
56
60
  c.switch ["sslv3"]
57
61
 
@@ -118,6 +122,7 @@ module Brightbox
118
122
  :listeners => listeners,
119
123
  :certificate_pem => ssl_cert,
120
124
  :certificate_private_key => ssl_key,
125
+ :ssl_minimum_version => options["ssl-min-ver"],
121
126
  :sslv3 => options["sslv3"],
122
127
  :nodes => nodes)
123
128
  render_table([lb], global_options)
@@ -18,6 +18,7 @@ module Brightbox
18
18
  :created_at,
19
19
  :deleted_at,
20
20
  :policy,
21
+ :ssl_minimum_version,
21
22
  :ssl_issuer,
22
23
  :ssl_subject,
23
24
  :ssl_valid_from,
@@ -45,6 +45,9 @@ module Brightbox
45
45
  c.desc "Filepath to the private key used to sign SSL certificate (OpenSSL supported formats)."
46
46
  c.flag ["ssl-key"]
47
47
 
48
+ c.desc "Sets the minimum version of TLS/SSL to support in the format 'TLSv1.x'"
49
+ c.flag ["ssl-min-ver"]
50
+
48
51
  c.desc "Clears SSL details from the load balancer."
49
52
  c.switch ["remove-ssl"], :negatable => false
50
53
 
@@ -128,6 +131,10 @@ module Brightbox
128
131
  lbopts[:certificate_private_key] = ""
129
132
  end
130
133
 
134
+ if options["ssl-min-ver"]
135
+ lbopts[:ssl_minimum_version] = options["ssl-min-ver"] unless options["ssl-min-ver"].nil?
136
+ end
137
+
131
138
  lbopts.nilify_blanks
132
139
 
133
140
  lb = LoadBalancer.find lb_id
@@ -12,6 +12,7 @@ module Brightbox
12
12
  def to_row
13
13
  attributes.merge(
14
14
  :locked => locked?,
15
+ :ssl_minimum_version => ssl_minimum_version,
15
16
  :ssl_issuer => certificate_issuer,
16
17
  :ssl_subject => certificate_subject,
17
18
  :ssl_valid_from => certificate_valid_from,
@@ -1,3 +1,3 @@
1
1
  module Brightbox
2
- VERSION = "3.0.1" unless defined?(Brightbox::VERSION)
2
+ VERSION = "3.1.0" unless defined?(Brightbox::VERSION)
3
3
  end
@@ -7,6 +7,11 @@ describe "brightbox lbs" do
7
7
  let(:stdout) { output.stdout }
8
8
  let(:stderr) { output.stderr }
9
9
 
10
+ before do
11
+ config = config_from_contents(USER_APP_CONFIG_CONTENTS)
12
+ cache_access_token(config, "f83da712e6299cda953513ec07f7a754f747d727")
13
+ end
14
+
10
15
  context "" do
11
16
  let(:argv) { %w(lbs create) }
12
17
 
@@ -14,5 +19,31 @@ describe "brightbox lbs" do
14
19
  expect { output }.to_not raise_error
15
20
  end
16
21
  end
22
+
23
+ context "--ssl-min-ver=TLSv1.0" do
24
+ let(:argv) { ["lbs", "create", "--ssl-min-ver", "TLSv1.0", "srv-12345"] }
25
+ let(:expected_args) { { ssl_minimum_version: "TLSv1.0" } }
26
+
27
+ let(:json_response) do
28
+ <<-EOS
29
+ {
30
+ "id":"lba-12345",
31
+ "ssl_minimum_version":"TLSv1.0"
32
+ }
33
+ EOS
34
+ end
35
+
36
+ before do
37
+ stub_request(:post, "http://api.brightbox.dev/1.0/load_balancers?account_id=acc-12345")
38
+ .with(:body => hash_including("ssl_minimum_version" => "TLSv1.0"))
39
+ .to_return(:status => 202, :body => json_response)
40
+ end
41
+
42
+ it "includes ssl_minimum_version in response" do
43
+ expect(Brightbox::LoadBalancer).to receive(:create).with(hash_including(expected_args)).and_call_original
44
+ expect(stderr).to eq("Creating a new load balancer\n")
45
+ expect(stdout).to include("lba-12345")
46
+ end
47
+ end
17
48
  end
18
49
  end
@@ -7,6 +7,11 @@ describe "brightbox lbs" do
7
7
  let(:stdout) { output.stdout }
8
8
  let(:stderr) { output.stderr }
9
9
 
10
+ before do
11
+ config = config_from_contents(USER_APP_CONFIG_CONTENTS)
12
+ cache_access_token(config, "f83da712e6299cda953513ec07f7a754f747d727")
13
+ end
14
+
10
15
  context "" do
11
16
  let(:argv) { %w(lbs update) }
12
17
 
@@ -14,5 +19,32 @@ describe "brightbox lbs" do
14
19
  expect { output }.to_not raise_error
15
20
  end
16
21
  end
22
+
23
+ context "--ssl-min-ver=TLSv1.0" do
24
+ let(:argv) { ["lbs", "update", "--ssl-min-ver", "TLSv1.0", "lba-12345"] }
25
+
26
+ let(:json_response) do
27
+ <<-EOS
28
+ {
29
+ "id":"lba-12345",
30
+ "ssl_minimum_version":"TLSv1.0"
31
+ }
32
+ EOS
33
+ end
34
+
35
+ before do
36
+ stub_request(:get, "http://api.brightbox.dev/1.0/load_balancers/lba-12345?account_id=acc-12345")
37
+ .to_return(:status => 200, :body => '{"id":"lba-12345"}')
38
+
39
+ stub_request(:put, "http://api.brightbox.dev/1.0/load_balancers/lba-12345?account_id=acc-12345")
40
+ .with(:body => hash_including("ssl_minimum_version" => "TLSv1.0"))
41
+ .to_return(:status => 202, :body => json_response)
42
+ end
43
+
44
+ it "includes ssl_minimum_version in response" do
45
+ expect(stderr).to eq("Updating load balancer lba-12345\n")
46
+ expect(stdout).to include("lba-12345")
47
+ end
48
+ end
17
49
  end
18
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brightbox-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Leach
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: 1.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fog-core
29
29
  requirement: !ruby/object:Gem::Requirement