brightbox-cli 2.9.3 → 2.10.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/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README +13 -0
- data/lib/brightbox-cli/commands/login.rb +2 -1
- data/lib/brightbox-cli/config.rb +1 -0
- data/lib/brightbox-cli/config/authentication_tokens.rb +3 -2
- data/lib/brightbox-cli/config/password_helper.rb +38 -0
- data/lib/brightbox-cli/version.rb +1 -1
- data/lib/brightbox_cli.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91e149ba9690fe26c97b144bb44335ad61bb1d4b618dc40cf25d67db0ce2125f
|
4
|
+
data.tar.gz: 671a10236bb00873715e7efbb833517bdada9fa473b53ae59ada833c5f213e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32983783ff888dbd51d1b3e2354e39d2958e9c88e44058e1a9e0f6e3eb660379fcb1b40d7b1a6b98a0911fbb95005fdd06d846b253efde60cf2da94abe42989e
|
7
|
+
data.tar.gz: 9f8b40a4566056cb001c6370e6f0b9b801e1955124610f0a993d6d3b6725c86643ee7452765c532e297b6be3886b081c22165ba7b2bca90a1ea664c1f636e4c9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### v2.10.0 / 2019-03-20
|
2
|
+
|
3
|
+
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v2.9.3...v2.10.0)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
* Support for using an external password manager by setting in configuration
|
8
|
+
|
1
9
|
### v2.9.3 /2019-03-06
|
2
10
|
|
3
11
|
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v2.9.2...v2.9.3)
|
data/Gemfile.lock
CHANGED
data/README
CHANGED
@@ -51,6 +51,19 @@ To browse available resources use the resource name as the command:
|
|
51
51
|
|
52
52
|
Command structure may be subject to change.
|
53
53
|
|
54
|
+
=== Integrating with a password manager
|
55
|
+
|
56
|
+
You can retrieve your passwords from an external password manager by specifying
|
57
|
+
a password helper command. This command will be executed any time your password
|
58
|
+
is required and its output used as your password.
|
59
|
+
|
60
|
+
Configure the command in your config file (usually ~/.brightbox/config) in the
|
61
|
+
appropriate section:
|
62
|
+
|
63
|
+
[john@example.com]
|
64
|
+
username = john@example.com
|
65
|
+
password_helper_command = pass john-example-com-brightbox
|
66
|
+
|
54
67
|
=== Using GPG to secure passwords
|
55
68
|
|
56
69
|
If you use an OAuth application to access your accounts
|
@@ -22,7 +22,8 @@ module Brightbox
|
|
22
22
|
raise "You must specify your email address" if email.nil?
|
23
23
|
|
24
24
|
password = options[:p]
|
25
|
-
password
|
25
|
+
password ||= Brightbox.config.gpg_password
|
26
|
+
password ||= Brightbox.config.password_helper_password
|
26
27
|
|
27
28
|
if !password || password.empty?
|
28
29
|
require "highline"
|
data/lib/brightbox-cli/config.rb
CHANGED
@@ -13,6 +13,7 @@ module Brightbox
|
|
13
13
|
include Brightbox::Logging
|
14
14
|
include Brightbox::Config::Cache
|
15
15
|
include Brightbox::Config::GpgEncryptedPasswords
|
16
|
+
include Brightbox::Config::PasswordHelper
|
16
17
|
include Brightbox::Config::AuthenticationTokens
|
17
18
|
include Brightbox::Config::Accounts
|
18
19
|
include Brightbox::Config::Clients
|
@@ -189,8 +189,9 @@ module Brightbox
|
|
189
189
|
def update_tokens_with_user_credentials(password = nil)
|
190
190
|
user_application = Brightbox::Config::UserApplication.new(selected_config, client_name)
|
191
191
|
|
192
|
-
password
|
193
|
-
password
|
192
|
+
password ||= gpg_password
|
193
|
+
password ||= password_helper_password
|
194
|
+
password ||= prompt_for_password
|
194
195
|
|
195
196
|
# FIXME: options are required to work
|
196
197
|
options = {
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Brightbox
|
2
|
+
module Config
|
3
|
+
module PasswordHelper
|
4
|
+
attr_accessor :password_helper_password
|
5
|
+
|
6
|
+
def password_helper_command
|
7
|
+
return config[client_name]["password_helper_command"] unless client_name.nil?
|
8
|
+
end
|
9
|
+
|
10
|
+
# Return the password from the helper if it's possible
|
11
|
+
def password_helper_password
|
12
|
+
if defined?(@password_helper_password) && !@password_helper_password.nil?
|
13
|
+
return @password_helper_password
|
14
|
+
end
|
15
|
+
|
16
|
+
if password_helper_command
|
17
|
+
@password_helper_password = password_helper_call
|
18
|
+
else
|
19
|
+
@password_helper_password = nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def password_helper_call
|
26
|
+
info "INFO: Calling password helper to obtain password"
|
27
|
+
begin
|
28
|
+
cmd = password_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.rb
CHANGED
@@ -71,6 +71,7 @@ require_relative "brightbox-cli/logging"
|
|
71
71
|
require_relative "brightbox-cli/api"
|
72
72
|
require_relative "brightbox-cli/config/cache"
|
73
73
|
require_relative "brightbox-cli/config/gpg_encrypted_passwords"
|
74
|
+
require_relative "brightbox-cli/config/password_helper"
|
74
75
|
require_relative "brightbox-cli/config/authentication_tokens"
|
75
76
|
require_relative "brightbox-cli/config/accounts"
|
76
77
|
require_relative "brightbox-cli/config/clients"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brightbox-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Leach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-brightbox
|
@@ -359,6 +359,7 @@ files:
|
|
359
359
|
- lib/brightbox-cli/config/clients.rb
|
360
360
|
- lib/brightbox-cli/config/dirty.rb
|
361
361
|
- lib/brightbox-cli/config/gpg_encrypted_passwords.rb
|
362
|
+
- lib/brightbox-cli/config/password_helper.rb
|
362
363
|
- lib/brightbox-cli/config/section_name_deduplicator.rb
|
363
364
|
- lib/brightbox-cli/config/sections.rb
|
364
365
|
- lib/brightbox-cli/config/to_fog.rb
|