brightbox-cli 2.10.0 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +2 -2
- data/lib/brightbox-cli/commands/login.rb +2 -0
- data/lib/brightbox-cli/config.rb +1 -0
- data/lib/brightbox-cli/config/authentication_tokens.rb +2 -0
- data/lib/brightbox-cli/config/two_factor_auth.rb +31 -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: 1f74c6d5e07fe744f3217182b736dd66ad18c849032f6be610d65af2bc8362f3
|
4
|
+
data.tar.gz: 9b5764ee9444858f285efb15720a640d32bb4d3519f495725ec6445c315ee538
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254847110a72093c3f32200b01a2f565f8a97cb3ae591e6a97a78966bdc959826944da0ef4e8a7127d52c07cbe90dbe1631a99e6c641a9b3be5a504edf7de3bb
|
7
|
+
data.tar.gz: e43d2bc0e2b47f369186d441688fec4f9021b6aa1df6c2735edc1826518630bb9a611b072c8eb3f2f7f1c8524d203adf8df1f08bb97fdc5c272e7d4048f5f8fa
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### v2.11.0 / 2019-06-06
|
2
|
+
|
3
|
+
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v2.10.0...v2.11.0)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
* Prompts for 2FA token if set up on a user account being used to authenticate.
|
8
|
+
|
1
9
|
### v2.10.0 / 2019-03-20
|
2
10
|
|
3
11
|
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v2.9.3...v2.10.0)
|
data/Gemfile.lock
CHANGED
data/lib/brightbox-cli/config.rb
CHANGED
@@ -14,6 +14,7 @@ module Brightbox
|
|
14
14
|
include Brightbox::Config::Cache
|
15
15
|
include Brightbox::Config::GpgEncryptedPasswords
|
16
16
|
include Brightbox::Config::PasswordHelper
|
17
|
+
include Brightbox::Config::TwoFactorAuth
|
17
18
|
include Brightbox::Config::AuthenticationTokens
|
18
19
|
include Brightbox::Config::Accounts
|
19
20
|
include Brightbox::Config::Clients
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Brightbox
|
2
|
+
module Config
|
3
|
+
module TwoFactorAuth
|
4
|
+
|
5
|
+
def extend_with_two_factor_pin(password)
|
6
|
+
if two_factor_enabled
|
7
|
+
suffix = "+" + two_factor_pin
|
8
|
+
password += suffix unless password.end_with?(suffix)
|
9
|
+
end
|
10
|
+
password
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def two_factor_enabled
|
16
|
+
return config[client_name]["two_factor"] == "true" unless client_name.nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
def two_factor_pin
|
20
|
+
@two_factor_pin ||= prompt_for_two_factor_pin if two_factor_enabled
|
21
|
+
end
|
22
|
+
|
23
|
+
def prompt_for_two_factor_pin
|
24
|
+
require "highline"
|
25
|
+
highline = HighLine.new
|
26
|
+
# FIXME: Capture interupts if user aborts
|
27
|
+
highline.ask("Enter your two factor pin : ")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/brightbox_cli.rb
CHANGED
@@ -72,6 +72,7 @@ require_relative "brightbox-cli/api"
|
|
72
72
|
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
|
+
require_relative "brightbox-cli/config/two_factor_auth"
|
75
76
|
require_relative "brightbox-cli/config/authentication_tokens"
|
76
77
|
require_relative "brightbox-cli/config/accounts"
|
77
78
|
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.11.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-
|
11
|
+
date: 2019-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-brightbox
|
@@ -363,6 +363,7 @@ files:
|
|
363
363
|
- lib/brightbox-cli/config/section_name_deduplicator.rb
|
364
364
|
- lib/brightbox-cli/config/sections.rb
|
365
365
|
- lib/brightbox-cli/config/to_fog.rb
|
366
|
+
- lib/brightbox-cli/config/two_factor_auth.rb
|
366
367
|
- lib/brightbox-cli/config/user_application.rb
|
367
368
|
- lib/brightbox-cli/connection_manager.rb
|
368
369
|
- lib/brightbox-cli/database_server.rb
|