brightbox-cli 3.2.0 → 3.3.0
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 +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +9 -7
- data/README +46 -13
- data/lib/brightbox-cli/commands/sql/snapshots_show.rb +6 -1
- data/lib/brightbox-cli/config/two_factor_auth.rb +4 -1
- data/lib/brightbox-cli/config/two_factor_helper.rb +38 -0
- data/lib/brightbox-cli/config.rb +1 -0
- data/lib/brightbox-cli/database_snapshot.rb +1 -1
- data/lib/brightbox-cli/version.rb +1 -1
- data/lib/brightbox_cli.rb +1 -0
- metadata +2 -2
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 881d758fc2932375edc56797f613f757a7f83729087cf2335a44736f4554fe1d
|
|
4
|
+
data.tar.gz: cfb933331637277089d47a0feccf9456e18b45f0a248aa27f233c52f24ba2f61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7b28703cc70a953b900f0caabaf036ff78c1e914810fcba9523b7f8b44ae5c7d148ee09f08d073d71449b587024f7d64ead1f88a659c3a2d2a52c502134d23a
|
|
7
|
+
data.tar.gz: ea62fcbe6b909e8b7cb8744da7acacd50c75bcb0c109fada221ef135ff1c1ac0d88dc01d8975ef3a8068c75e86956ce244ab88abc641e2dc3d79ed474502e59d
|
data/.github/workflows/ruby.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
### v3.3.0 / 2021-09-17
|
|
2
|
+
|
|
3
|
+
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v3.2.0...v3.3.0)
|
|
4
|
+
|
|
5
|
+
Changes:
|
|
6
|
+
|
|
7
|
+
* Update `fog-brightbox` to v1.4.0` (allowing Ruby 3.0 support)
|
|
8
|
+
* Added support for getting 2FA from helper
|
|
9
|
+
* Added missing `sql snapshot` fields
|
|
10
|
+
* Infrastructure changes to test on more versions of Ruby
|
|
11
|
+
* Added GitHub actions support for CI testing.
|
|
12
|
+
* Removed Travis CI support.
|
|
13
|
+
|
|
14
|
+
Bug fixes:
|
|
15
|
+
|
|
16
|
+
* Updates `crack` gem to switch from `safe_yaml` to `rexml`
|
|
17
|
+
* Bump addressable from 2.3.8 to 2.8.0. (fixing ReDoS vulnerability)
|
|
18
|
+
* Bump rexml from 3.2.4 to 3.2.5 (fixing round-trip vulnerability bugs)
|
|
19
|
+
|
|
1
20
|
### v3.2.0 / 2020-11-26
|
|
2
21
|
|
|
3
22
|
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v3.1.0...v3.2.0)
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
brightbox-cli (3.
|
|
4
|
+
brightbox-cli (3.3.0)
|
|
5
5
|
dry-inflector (< 0.2)
|
|
6
6
|
fog-brightbox (>= 1.3.0)
|
|
7
7
|
fog-core (< 2.0)
|
|
@@ -15,15 +15,16 @@ PATH
|
|
|
15
15
|
GEM
|
|
16
16
|
remote: https://rubygems.org/
|
|
17
17
|
specs:
|
|
18
|
-
addressable (2.
|
|
18
|
+
addressable (2.8.0)
|
|
19
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
19
20
|
builder (3.2.4)
|
|
20
21
|
coderay (1.0.9)
|
|
21
|
-
crack (0.4.
|
|
22
|
-
|
|
22
|
+
crack (0.4.5)
|
|
23
|
+
rexml
|
|
23
24
|
diff-lcs (1.4.3)
|
|
24
25
|
dry-inflector (0.1.2)
|
|
25
|
-
excon (0.
|
|
26
|
-
fog-brightbox (1.
|
|
26
|
+
excon (0.79.0)
|
|
27
|
+
fog-brightbox (1.4.0)
|
|
27
28
|
dry-inflector
|
|
28
29
|
fog-core (>= 1.45, < 3.0)
|
|
29
30
|
fog-json
|
|
@@ -52,7 +53,9 @@ GEM
|
|
|
52
53
|
pry-remote (0.1.8)
|
|
53
54
|
pry (~> 0.9)
|
|
54
55
|
slop (~> 3.0)
|
|
56
|
+
public_suffix (2.0.5)
|
|
55
57
|
rake (12.3.3)
|
|
58
|
+
rexml (3.2.5)
|
|
56
59
|
rspec (3.9.0)
|
|
57
60
|
rspec-core (~> 3.9.0)
|
|
58
61
|
rspec-expectations (~> 3.9.0)
|
|
@@ -66,7 +69,6 @@ GEM
|
|
|
66
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
67
70
|
rspec-support (~> 3.9.0)
|
|
68
71
|
rspec-support (3.9.3)
|
|
69
|
-
safe_yaml (1.0.4)
|
|
70
72
|
slop (3.4.5)
|
|
71
73
|
vcr (2.5.0)
|
|
72
74
|
webmock (1.21.0)
|
data/README
CHANGED
|
@@ -9,17 +9,6 @@ You can sign up at https://manage.brightbox.com
|
|
|
9
9
|
|
|
10
10
|
{<img src="https://travis-ci.org/brightbox/brightbox-cli.png?branch=master" alt="Build Status" />}[https://travis-ci.org/brightbox/brightbox-cli]
|
|
11
11
|
|
|
12
|
-
== UPGRADE NOTES
|
|
13
|
-
|
|
14
|
-
Version 1.0.0 adds a new top level `brightbox` command for the suite.
|
|
15
|
-
|
|
16
|
-
This may clash with our `brightbox` (brightbox-deployment) gem which, before
|
|
17
|
-
version 2.4.0, used `brightbox` as the name for it's binary. Please ensure you
|
|
18
|
-
update your `brightbox` gem to avoid using the wrong command.
|
|
19
|
-
|
|
20
|
-
We have included backwards compatible binaries for all the older CLI commands
|
|
21
|
-
(brightbox-accounts, brightbox-servers etc...) but recommend getting used to the
|
|
22
|
-
new form.
|
|
23
12
|
|
|
24
13
|
== Installation instructions
|
|
25
14
|
|
|
@@ -36,7 +25,11 @@ For a list of available commands use:
|
|
|
36
25
|
|
|
37
26
|
$ brightbox help
|
|
38
27
|
|
|
39
|
-
To
|
|
28
|
+
To login with your user credentials use:
|
|
29
|
+
|
|
30
|
+
$ brightbox login john@example.com
|
|
31
|
+
|
|
32
|
+
To instead add api client (account-specific) credentials use:
|
|
40
33
|
|
|
41
34
|
$ brightbox config client_add cli-2igtb theclientsecret
|
|
42
35
|
Using config file /home/ubuntu/.brightbox/config
|
|
@@ -49,7 +42,14 @@ To browse available resources use the resource name as the command:
|
|
|
49
42
|
$ brightbox images
|
|
50
43
|
... List of images
|
|
51
44
|
|
|
52
|
-
|
|
45
|
+
=== Two factor authentication ===
|
|
46
|
+
|
|
47
|
+
If you've enabled two factor authentication for your user, you can enable it in
|
|
48
|
+
your config and the CLI will prompt for a two factor pin when needed:
|
|
49
|
+
|
|
50
|
+
[john@example.com]
|
|
51
|
+
username = john@example.com
|
|
52
|
+
two_factor = true
|
|
53
53
|
|
|
54
54
|
=== Integrating with a password manager
|
|
55
55
|
|
|
@@ -64,6 +64,13 @@ appropriate section:
|
|
|
64
64
|
username = john@example.com
|
|
65
65
|
password_helper_command = pass john-example-com-brightbox
|
|
66
66
|
|
|
67
|
+
You can also specify a separate helper command to retrive two factor pins:
|
|
68
|
+
|
|
69
|
+
[john@example.com]
|
|
70
|
+
username = john@example.com
|
|
71
|
+
password_helper_command = pass john-example-com-brightbox
|
|
72
|
+
two_factor_helper_command = get-two-factor-pin john-example-com-brightbox
|
|
73
|
+
|
|
67
74
|
=== Using GPG to secure passwords
|
|
68
75
|
|
|
69
76
|
If you use an OAuth application to access your accounts
|
|
@@ -108,6 +115,20 @@ incorrectly or there may be an issue with your GPG configuration.
|
|
|
108
115
|
|
|
109
116
|
To remove the password delete the `~/.brightbox/main.password.gpg` file.
|
|
110
117
|
|
|
118
|
+
=== Integrating with a password manager
|
|
119
|
+
|
|
120
|
+
You can retrieve your passwords from an external password manager by specifying
|
|
121
|
+
a password helper command. This command will be executed any time your password
|
|
122
|
+
is required and its output used as your password.
|
|
123
|
+
|
|
124
|
+
Configure the command in your config file (usually ~/.brightbox/config) in the
|
|
125
|
+
appropriate section:
|
|
126
|
+
|
|
127
|
+
[john@example.com]
|
|
128
|
+
username = john@example.com
|
|
129
|
+
password_helper_command = pass john-example-com-brightbox
|
|
130
|
+
|
|
131
|
+
|
|
111
132
|
== Usage guides
|
|
112
133
|
|
|
113
134
|
* http://docs.brightbox.com/reference/cli
|
|
@@ -130,6 +151,18 @@ in the path, just specify the full path to it:
|
|
|
130
151
|
|
|
131
152
|
complete -C /full/path/to/bin/_brightbox-bash-completer -o filenames brightbox
|
|
132
153
|
|
|
154
|
+
== UPGRADE NOTES
|
|
155
|
+
|
|
156
|
+
Version 1.0.0 adds a new top level `brightbox` command for the suite.
|
|
157
|
+
|
|
158
|
+
This may clash with our `brightbox` (brightbox-deployment) gem which, before
|
|
159
|
+
version 2.4.0, used `brightbox` as the name for it's binary. Please ensure you
|
|
160
|
+
update your `brightbox` gem to avoid using the wrong command.
|
|
161
|
+
|
|
162
|
+
We have included backwards compatible binaries for all the older CLI commands
|
|
163
|
+
(brightbox-accounts, brightbox-servers etc...) but recommend getting used to the
|
|
164
|
+
new form.
|
|
165
|
+
|
|
133
166
|
== Testing
|
|
134
167
|
|
|
135
168
|
You should be able to run the specs and features with the following steps:
|
|
@@ -17,7 +17,10 @@ module Brightbox
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def two_factor_pin
|
|
20
|
-
|
|
20
|
+
if two_factor_enabled
|
|
21
|
+
@two_factor_pin ||= Brightbox.config.two_factor_helper_password
|
|
22
|
+
@two_factor_pin ||= prompt_for_two_factor_pin
|
|
23
|
+
end
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
def prompt_for_two_factor_pin
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Brightbox
|
|
2
|
+
module Config
|
|
3
|
+
module TwoFactorHelper
|
|
4
|
+
attr_accessor :two_factor_helper_password
|
|
5
|
+
|
|
6
|
+
def two_factor_helper_command
|
|
7
|
+
return config[client_name]["two_factor_helper_command"] unless client_name.nil?
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Return the two_factor code from the helper if it's possible
|
|
11
|
+
def two_factor_helper_password
|
|
12
|
+
if defined?(@two_factor_helper_password) && !@two_factor_helper_password.nil?
|
|
13
|
+
return @two_factor_helper_password
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
if two_factor_helper_command
|
|
17
|
+
@two_factor_helper_password = two_factor_helper_call
|
|
18
|
+
else
|
|
19
|
+
@two_factor_helper_password = nil
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def two_factor_helper_call
|
|
26
|
+
info "INFO: Calling two factor helper to obtain two factor"
|
|
27
|
+
begin
|
|
28
|
+
cmd = two_factor_helper_command.split(/\s+/)
|
|
29
|
+
IO.popen(cmd, "r") do |io|
|
|
30
|
+
io.readline.chomp
|
|
31
|
+
end
|
|
32
|
+
rescue Errno::ENOENT
|
|
33
|
+
nil
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/brightbox-cli/config.rb
CHANGED
|
@@ -15,6 +15,7 @@ module Brightbox
|
|
|
15
15
|
include Brightbox::Config::GpgEncryptedPasswords
|
|
16
16
|
include Brightbox::Config::PasswordHelper
|
|
17
17
|
include Brightbox::Config::TwoFactorAuth
|
|
18
|
+
include Brightbox::Config::TwoFactorHelper
|
|
18
19
|
include Brightbox::Config::AuthenticationTokens
|
|
19
20
|
include Brightbox::Config::Accounts
|
|
20
21
|
include Brightbox::Config::Clients
|
data/lib/brightbox_cli.rb
CHANGED
|
@@ -73,6 +73,7 @@ require_relative "brightbox-cli/config/cache"
|
|
|
73
73
|
require_relative "brightbox-cli/config/gpg_encrypted_passwords"
|
|
74
74
|
require_relative "brightbox-cli/config/password_helper"
|
|
75
75
|
require_relative "brightbox-cli/config/two_factor_auth"
|
|
76
|
+
require_relative "brightbox-cli/config/two_factor_helper"
|
|
76
77
|
require_relative "brightbox-cli/config/authentication_tokens"
|
|
77
78
|
require_relative "brightbox-cli/config/accounts"
|
|
78
79
|
require_relative "brightbox-cli/config/clients"
|
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.
|
|
4
|
+
version: 3.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Leach
|
|
@@ -243,7 +243,6 @@ extra_rdoc_files: []
|
|
|
243
243
|
files:
|
|
244
244
|
- ".github/workflows/ruby.yml"
|
|
245
245
|
- ".gitignore"
|
|
246
|
-
- ".travis.yml"
|
|
247
246
|
- CHANGELOG.md
|
|
248
247
|
- Gemfile
|
|
249
248
|
- Gemfile.lock
|
|
@@ -373,6 +372,7 @@ files:
|
|
|
373
372
|
- lib/brightbox-cli/config/sections.rb
|
|
374
373
|
- lib/brightbox-cli/config/to_fog.rb
|
|
375
374
|
- lib/brightbox-cli/config/two_factor_auth.rb
|
|
375
|
+
- lib/brightbox-cli/config/two_factor_helper.rb
|
|
376
376
|
- lib/brightbox-cli/config/user_application.rb
|
|
377
377
|
- lib/brightbox-cli/connection_manager.rb
|
|
378
378
|
- lib/brightbox-cli/database_server.rb
|