brightbox-cli 2.2.0 → 2.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.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/Gemfile.lock +5 -2
  4. data/brightbox-cli.gemspec +1 -1
  5. data/lib/brightbox/cli/config.rb +19 -0
  6. data/lib/brightbox-cli/accounts.rb +2 -2
  7. data/lib/brightbox-cli/api.rb +4 -4
  8. data/lib/brightbox-cli/commands/accounts/default.rb +1 -1
  9. data/lib/brightbox-cli/commands/accounts/list.rb +1 -1
  10. data/lib/brightbox-cli/commands/config/client-add.rb +2 -2
  11. data/lib/brightbox-cli/commands/config/client-default.rb +3 -3
  12. data/lib/brightbox-cli/commands/config/client-list.rb +6 -6
  13. data/lib/brightbox-cli/commands/config/client-remove.rb +4 -4
  14. data/lib/brightbox-cli/commands/config/user-add.rb +2 -2
  15. data/lib/brightbox-cli/commands/login.rb +53 -0
  16. data/lib/brightbox-cli/config/accounts.rb +5 -0
  17. data/lib/brightbox-cli/config/authentication_tokens.rb +10 -3
  18. data/lib/brightbox-cli/config/cache.rb +8 -12
  19. data/lib/brightbox-cli/config/clients.rb +14 -38
  20. data/lib/brightbox-cli/config/sections.rb +70 -13
  21. data/lib/brightbox-cli/config/user_application.rb +13 -5
  22. data/lib/brightbox-cli/config.rb +22 -14
  23. data/lib/brightbox-cli/connection_manager.rb +2 -2
  24. data/lib/brightbox-cli/gli_global_hooks.rb +25 -28
  25. data/lib/brightbox-cli/version.rb +1 -1
  26. data/lib/brightbox_cli.rb +4 -0
  27. data/spec/cassettes/Brightbox_BBConfig/_add_section/when_config_exists_and_overwrite_duplicates_is_false/does_not_update_the_config_file.yml +199 -0
  28. data/spec/cassettes/Brightbox_BBConfig/_add_section/when_config_exists_and_overwrite_duplicates_is_true/does_not_update_the_config_file.yml +199 -0
  29. data/spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/does_not_alter_the_configuration.yml +99 -0
  30. data/spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/updates_access_token.yml +99 -0
  31. data/spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/updates_refresh_token.yml +99 -0
  32. data/spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/does_not_alter_the_configuration.yml +99 -0
  33. data/spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/updates_access_token.yml +99 -0
  34. data/spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/updates_refresh_token.yml +99 -0
  35. data/spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/does_not_alter_the_configuration.yml +149 -0
  36. data/spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/updates_access_token.yml +149 -0
  37. data/spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/updates_refresh_token.yml +149 -0
  38. data/spec/cassettes/Brightbox_BBConfig_add_login/when_no_config_exists/creates_the_configuration.yml +101 -0
  39. data/spec/cassettes/Brightbox_BBConfig_add_login/when_no_config_exists/refreshed_tokens.yml +101 -0
  40. data/spec/cassettes/Brightbox_BBConfig_add_login/when_using_an_email_and_suffix/creates_the_configuration.yml +101 -0
  41. data/spec/cassettes/Brightbox_BBConfig_add_login/when_using_an_email_and_suffix/refreshed_tokens.yml +101 -0
  42. data/spec/cassettes/brightbox_accounts/list/_when_access_token_expired_/does_not_report_invalid_token_errors.yml +64 -18
  43. data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_/does_not_report_invalid_token_errors.yml +62 -16
  44. data/spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/does_not_error.yml +101 -0
  45. data/spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/does_not_prompt_to_rerun_the_command.yml +101 -0
  46. data/spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/prompts_for_the_password.yml +101 -0
  47. data/spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/requests_access_tokens.yml +101 -0
  48. data/spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/sets_up_the_config.yml +101 -0
  49. data/spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/does_not_error.yml +101 -0
  50. data/spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/does_not_prompt_to_rerun_the_command.yml +101 -0
  51. data/spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/prompts_for_the_password.yml +101 -0
  52. data/spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/requests_access_tokens.yml +101 -0
  53. data/spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/sets_up_the_config.yml +101 -0
  54. data/spec/cassettes/brightbox_login/when_default_account_is_passed/does_not_error.yml +51 -0
  55. data/spec/cassettes/brightbox_login/when_default_account_is_passed/does_not_prompt_to_rerun_the_command.yml +51 -0
  56. data/spec/cassettes/brightbox_login/when_default_account_is_passed/prompts_for_the_password.yml +51 -0
  57. data/spec/cassettes/brightbox_login/when_default_account_is_passed/requests_access_tokens.yml +51 -0
  58. data/spec/cassettes/brightbox_login/when_default_account_is_passed/sets_up_the_config.yml +51 -0
  59. data/spec/cassettes/brightbox_login/when_no_config_is_present/does_not_error.yml +101 -0
  60. data/spec/cassettes/brightbox_login/when_no_config_is_present/does_not_prompt_to_rerun_the_command.yml +101 -0
  61. data/spec/cassettes/brightbox_login/when_no_config_is_present/requests_access_tokens.yml +101 -0
  62. data/spec/cassettes/brightbox_login/when_no_config_is_present/sets_up_the_config.yml +101 -0
  63. data/spec/cassettes/brightbox_login/when_no_password_is_given/does_not_error.yml +101 -0
  64. data/spec/cassettes/brightbox_login/when_no_password_is_given/does_not_prompt_to_rerun_the_command.yml +101 -0
  65. data/spec/cassettes/brightbox_login/when_no_password_is_given/prompts_for_the_password.yml +101 -0
  66. data/spec/cassettes/brightbox_login/when_no_password_is_given/requests_access_tokens.yml +101 -0
  67. data/spec/cassettes/brightbox_login/when_no_password_is_given/sets_up_the_config.yml +101 -0
  68. data/spec/commands/accounts/list_spec.rb +1 -0
  69. data/spec/commands/login_spec.rb +239 -0
  70. data/spec/configs/user_app.ini +0 -2
  71. data/spec/spec_helper.rb +1 -0
  72. data/spec/support/config_helpers.rb +5 -0
  73. data/spec/unit/brightbox/account/all_spec.rb +1 -3
  74. data/spec/unit/brightbox/api/conn_spec.rb +3 -0
  75. data/spec/unit/brightbox/api/find_spec.rb +3 -0
  76. data/spec/unit/brightbox/bb_config/account_spec.rb +2 -0
  77. data/spec/unit/brightbox/bb_config/add_login_spec.rb +222 -0
  78. data/spec/unit/brightbox/bb_config/client_name_spec.rb +4 -12
  79. data/spec/unit/brightbox/bb_config/client_named_spec.rb +1 -1
  80. data/spec/unit/brightbox/bb_config/config_directory_exists_spec.rb +5 -2
  81. data/spec/unit/brightbox/bb_config/config_directory_spec.rb +4 -2
  82. data/spec/unit/brightbox/bb_config/config_spec.rb +4 -8
  83. data/spec/unit/brightbox/bb_config/default_account_spec.rb +10 -6
  84. data/spec/unit/brightbox/bb_config/find_or_set_default_account_spec.rb +2 -0
  85. data/spec/unit/brightbox/bb_config/renew_tokens_spec.rb +3 -0
  86. data/spec/unit/brightbox/bb_config/section_names_spec.rb +46 -0
  87. data/spec/unit/brightbox/bb_config/using_client_spec.rb +12 -12
  88. data/spec/unit/brightbox/bb_config_spec.rb +0 -1
  89. data/spec/unit/brightbox/cloud_ip/find_spec.rb +3 -0
  90. data/spec/unit/brightbox/config/user_application/to_fog_spec.rb +33 -29
  91. data/spec/unit/brightbox/config/user_application/valid_spec.rb +0 -32
  92. data/spec/unit/brightbox/connection_manager/fetch_connection_spec.rb +7 -3
  93. data/spec/unit/brightbox/firewall_policy/apply_to_spec.rb +3 -0
  94. data/spec/unit/brightbox/firewall_policy/create_spec.rb +3 -0
  95. data/spec/unit/brightbox/firewall_policy/destroy_spec.rb +3 -0
  96. data/spec/unit/brightbox/firewall_policy/find_or_call_spec.rb +3 -0
  97. data/spec/unit/brightbox/firewall_policy/find_spec.rb +3 -0
  98. data/spec/unit/brightbox/firewall_rule/create_spec.rb +3 -0
  99. data/spec/unit/brightbox/firewall_rule/destroy_spec.rb +3 -0
  100. data/spec/unit/brightbox/firewall_rule/find_spec.rb +3 -0
  101. data/spec/unit/brightbox/firewall_rule/from_policy_spec.rb +3 -0
  102. data/spec/unit/brightbox/server/destroy_spec.rb +4 -0
  103. data/spec/unit/brightbox/server/find_or_call_spec.rb +3 -0
  104. data/spec/unit/brightbox/server/find_spec.rb +4 -0
  105. data/spec/unit/brightbox/server/shutdown_spec.rb +4 -0
  106. data/spec/unit/brightbox/server/start_spec.rb +4 -0
  107. data/spec/unit/brightbox/server/stop_spec.rb +4 -0
  108. data/spec/unit/brightbox/server/update_spec.rb +4 -0
  109. data/spec/unit/brightbox/server_group/find_spec.rb +3 -0
  110. data/spec/unit/brightbox/user_collaboration/get_for_account_spec.rb +3 -0
  111. metadata +90 -3
@@ -13,8 +13,6 @@ describe Brightbox::Config::UserApplication do
13
13
  <<-EOS
14
14
  [#{client_name}]
15
15
  api_url = http://api.brightbox.dev
16
- client_id = #{client_name}
17
- secret = #{random_token}
18
16
  username = user@example.com
19
17
  EOS
20
18
  end
@@ -56,36 +54,6 @@ describe Brightbox::Config::UserApplication do
56
54
  end
57
55
  end
58
56
 
59
- context "when config is missing client_id" do
60
- let(:contents) do
61
- <<-EOS
62
- [#{client_name}]
63
- api_url = http://api.brightbox.dev
64
- secret = #{random_token}
65
- username = user@example.com
66
- EOS
67
- end
68
-
69
- it "is invalid" do
70
- expect(section).to_not be_valid
71
- end
72
- end
73
-
74
- context "when config is missing secret" do
75
- let(:contents) do
76
- <<-EOS
77
- [#{client_name}]
78
- api_url = http://api.brightbox.dev
79
- client_id = #{client_name}
80
- username = user@example.com
81
- EOS
82
- end
83
-
84
- it "is invalid" do
85
- expect(section).to_not be_valid
86
- end
87
- end
88
-
89
57
  context "when config is missing username" do
90
58
  let(:contents) do
91
59
  <<-EOS
@@ -1,6 +1,10 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::ConnectionManager, "#fetch_connection" do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
7
+
4
8
  let(:connection_manager) { Brightbox::ConnectionManager.new(connection_options) }
5
9
  let(:connection_options) do
6
10
  {
@@ -31,7 +35,7 @@ describe Brightbox::ConnectionManager, "#fetch_connection" do
31
35
  connection = connection_manager.fetch_connection(false)
32
36
  expect(connection).not_to be_nil
33
37
 
34
- expect($config).to receive(:account).and_return("acc-abcde")
38
+ expect(Brightbox.config).to receive(:account).and_return("acc-abcde")
35
39
  connection2 = connection_manager.fetch_connection(true)
36
40
  expect(connection2).to eq(connection)
37
41
  expect(connection2.scoped_account).not_to be_nil
@@ -48,7 +52,7 @@ describe Brightbox::ConnectionManager, "#fetch_connection" do
48
52
 
49
53
  it "selects configured account" do
50
54
  skip "Fails out of sequence, mocked config incorrect"
51
- $config.stubs(:selected_config).returns('default_account' => "acc-12345")
55
+ Brightbox.config.stubs(:selected_config).returns('default_account' => "acc-12345")
52
56
  connection = connection_manager.fetch_connection(true)
53
57
  expect(connection).not_to be_nil
54
58
  expect(connection.scoped_account).to eq("acc-12345")
@@ -58,7 +62,7 @@ describe Brightbox::ConnectionManager, "#fetch_connection" do
58
62
  context "when user has one account" do
59
63
  it "selects that account" do
60
64
  skip "Fails out of sequence, mocked config incorrect"
61
- allow($config).to receive(:selected_config).and_call_original
65
+ allow(Brightbox.config).to receive(:selected_config).and_call_original
62
66
  mock_account = double
63
67
  mock_account.expects(:id).returns("acc-xyg")
64
68
 
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#apply_to", vcr: true do
6
9
 
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#create", vcr: true do
6
9
 
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#destroy", vcr: true do
6
9
  it "should destroy firewall policy" do
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#find_or_call" do
6
9
 
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#find(:all)", vcr: true do
6
9
 
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallRule do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#create" do
6
9
  context "when policy exists" do
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallRule do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#destroy", vcr: true do
6
9
  context "when rule exists" do
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallRule do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#find", vcr: true do
6
9
  context "when rule exists" do
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallRule do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe ".from_policy", vcr: true do
6
9
  context "when policy exists with a rule" do
@@ -3,6 +3,10 @@ require "spec_helper"
3
3
  describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
+ before do
7
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
8
+ end
9
+
6
10
  describe "#destroy" do
7
11
  context "when server exists", vcr: true do
8
12
  it "should work" do
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::Server do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#show", vcr: true do
6
9
  context "when server exists" do
@@ -1,6 +1,10 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::Server do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
7
+
4
8
  let(:image_id) { "img-12345" }
5
9
 
6
10
  describe "#find(:all)" do
@@ -3,6 +3,10 @@ require "spec_helper"
3
3
  describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
+ before do
7
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
8
+ end
9
+
6
10
  describe "#shutdown", vcr: true do
7
11
  it "should work" do
8
12
  type = Brightbox::Type.find_by_handle "nano"
@@ -3,6 +3,10 @@ require "spec_helper"
3
3
  describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
+ before do
7
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
8
+ end
9
+
6
10
  describe "#start", vcr: true do
7
11
  it "should work" do
8
12
  type = Brightbox::Type.find_by_handle "nano"
@@ -3,6 +3,10 @@ require "spec_helper"
3
3
  describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
+ before do
7
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
8
+ end
9
+
6
10
  describe "#stop", vcr: true do
7
11
  it "should work" do
8
12
  type = Brightbox::Type.find_by_handle "nano"
@@ -1,6 +1,10 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::Server do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
7
+
4
8
  let(:image_id) { "img-12345" }
5
9
 
6
10
  describe "#update" do
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::ServerGroup do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe "#find(:all)" do
6
9
  context "when a group exists", vcr: true do
@@ -1,6 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Brightbox::UserCollaboration do
4
+ before do
5
+ config_from_contents(API_CLIENT_CONFIG_CONTENTS)
6
+ end
4
7
 
5
8
  describe ".get_for_account" do
6
9
  before do
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.2.0
4
+ version: 2.3.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: 2015-10-12 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-brightbox
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: pry
126
+ name: pry-remote
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -281,6 +281,7 @@ files:
281
281
  - lib/brightbox-cli/commands/lbs/remove-nodes.rb
282
282
  - lib/brightbox-cli/commands/lbs/show.rb
283
283
  - lib/brightbox-cli/commands/lbs/update.rb
284
+ - lib/brightbox-cli/commands/login.rb
284
285
  - lib/brightbox-cli/commands/servers/activate-console.rb
285
286
  - lib/brightbox-cli/commands/servers/create.rb
286
287
  - lib/brightbox-cli/commands/servers/destroy.rb
@@ -361,6 +362,7 @@ files:
361
362
  - lib/brightbox-cli/vendor/brightbox-ini/test/test_inifile.rb
362
363
  - lib/brightbox-cli/version.rb
363
364
  - lib/brightbox-cli/zones.rb
365
+ - lib/brightbox/cli/config.rb
364
366
  - lib/brightbox_cli.rb
365
367
  - locales/en.yml
366
368
  - spec/brightbox_spec.rb
@@ -368,6 +370,8 @@ files:
368
370
  - spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_resources_on_the_same_connection.yml
369
371
  - spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_a_collection_of_Accounts.yml
370
372
  - spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_resources_on_the_same_connection.yml
373
+ - spec/cassettes/Brightbox_BBConfig/_add_section/when_config_exists_and_overwrite_duplicates_is_false/does_not_update_the_config_file.yml
374
+ - spec/cassettes/Brightbox_BBConfig/_add_section/when_config_exists_and_overwrite_duplicates_is_true/does_not_update_the_config_file.yml
371
375
  - spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_changes_to_the_config_file.yml
372
376
  - spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_default_account.yml
373
377
  - spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_new_client_as_the_default.yml
@@ -379,6 +383,19 @@ files:
379
383
  - spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/caches_the_new_tokens.yml
380
384
  - spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/prompts_user_to_retry_command.yml
381
385
  - spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_an_API_client_with_no_tokens/caches_a_new_access_token.yml
386
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/does_not_alter_the_configuration.yml
387
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/updates_access_token.yml
388
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/updates_refresh_token.yml
389
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/does_not_alter_the_configuration.yml
390
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/updates_access_token.yml
391
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/updates_refresh_token.yml
392
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/does_not_alter_the_configuration.yml
393
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/updates_access_token.yml
394
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/updates_refresh_token.yml
395
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_no_config_exists/creates_the_configuration.yml
396
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_no_config_exists/refreshed_tokens.yml
397
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_using_an_email_and_suffix/creates_the_configuration.yml
398
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_using_an_email_and_suffix/refreshed_tokens.yml
382
399
  - spec/cassettes/Brightbox_CloudIP/_find_all_/when_a_Cloud_IP_exists/returns_a_suitable.yml
383
400
  - spec/cassettes/Brightbox_FirewallPolicy/_apply_to/should_apply_firewall_policy.yml
384
401
  - spec/cassettes/Brightbox_FirewallPolicy/_create/should_create_firewall_policy.yml
@@ -448,6 +465,30 @@ files:
448
465
  - spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/does_not_output_to_stderr.yml
449
466
  - spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/outputs_table_details_to_stdout.yml
450
467
  - spec/cassettes/brightbox_database-snapshots/show/when_resource_exists/does_not_output_to_stderr.yml
468
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/does_not_error.yml
469
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/does_not_prompt_to_rerun_the_command.yml
470
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/prompts_for_the_password.yml
471
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/requests_access_tokens.yml
472
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/sets_up_the_config.yml
473
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/does_not_error.yml
474
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/does_not_prompt_to_rerun_the_command.yml
475
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/prompts_for_the_password.yml
476
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/requests_access_tokens.yml
477
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/sets_up_the_config.yml
478
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/does_not_error.yml
479
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/does_not_prompt_to_rerun_the_command.yml
480
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/prompts_for_the_password.yml
481
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/requests_access_tokens.yml
482
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/sets_up_the_config.yml
483
+ - spec/cassettes/brightbox_login/when_no_config_is_present/does_not_error.yml
484
+ - spec/cassettes/brightbox_login/when_no_config_is_present/does_not_prompt_to_rerun_the_command.yml
485
+ - spec/cassettes/brightbox_login/when_no_config_is_present/requests_access_tokens.yml
486
+ - spec/cassettes/brightbox_login/when_no_config_is_present/sets_up_the_config.yml
487
+ - spec/cassettes/brightbox_login/when_no_password_is_given/does_not_error.yml
488
+ - spec/cassettes/brightbox_login/when_no_password_is_given/does_not_prompt_to_rerun_the_command.yml
489
+ - spec/cassettes/brightbox_login/when_no_password_is_given/prompts_for_the_password.yml
490
+ - spec/cassettes/brightbox_login/when_no_password_is_given/requests_access_tokens.yml
491
+ - spec/cassettes/brightbox_login/when_no_password_is_given/sets_up_the_config.yml
451
492
  - spec/commands/accounts/default_spec.rb
452
493
  - spec/commands/accounts/list_spec.rb
453
494
  - spec/commands/accounts/reset_ftp_password_spec.rb
@@ -487,6 +528,7 @@ files:
487
528
  - spec/commands/lbs/remove_nodes_spec.rb
488
529
  - spec/commands/lbs/show_spec.rb
489
530
  - spec/commands/lbs/update_spec.rb
531
+ - spec/commands/login_spec.rb
490
532
  - spec/commands/policies/apply_spec.rb
491
533
  - spec/commands/policies/create_spec.rb
492
534
  - spec/commands/policies/destroy_spec.rb
@@ -549,6 +591,7 @@ files:
549
591
  - spec/unit/brightbox/bb_config/access_token_filename_spec.rb
550
592
  - spec/unit/brightbox/bb_config/access_token_spec.rb
551
593
  - spec/unit/brightbox/bb_config/account_spec.rb
594
+ - spec/unit/brightbox/bb_config/add_login_spec.rb
552
595
  - spec/unit/brightbox/bb_config/add_section_spec.rb
553
596
  - spec/unit/brightbox/bb_config/clear_default_client_spec.rb
554
597
  - spec/unit/brightbox/bb_config/client_alias_spec.rb
@@ -570,6 +613,7 @@ files:
570
613
  - spec/unit/brightbox/bb_config/renew_tokens_spec.rb
571
614
  - spec/unit/brightbox/bb_config/save_default_account_spec.rb
572
615
  - spec/unit/brightbox/bb_config/save_spec.rb
616
+ - spec/unit/brightbox/bb_config/section_names_spec.rb
573
617
  - spec/unit/brightbox/bb_config/to_fog_spec.rb
574
618
  - spec/unit/brightbox/bb_config/update_stored_tokens_spec.rb
575
619
  - spec/unit/brightbox/bb_config/using_client_spec.rb
@@ -678,6 +722,8 @@ test_files:
678
722
  - spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_resources_on_the_same_connection.yml
679
723
  - spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_a_collection_of_Accounts.yml
680
724
  - spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_resources_on_the_same_connection.yml
725
+ - spec/cassettes/Brightbox_BBConfig/_add_section/when_config_exists_and_overwrite_duplicates_is_false/does_not_update_the_config_file.yml
726
+ - spec/cassettes/Brightbox_BBConfig/_add_section/when_config_exists_and_overwrite_duplicates_is_true/does_not_update_the_config_file.yml
681
727
  - spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_changes_to_the_config_file.yml
682
728
  - spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_default_account.yml
683
729
  - spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_new_client_as_the_default.yml
@@ -689,6 +735,19 @@ test_files:
689
735
  - spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/caches_the_new_tokens.yml
690
736
  - spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/prompts_user_to_retry_command.yml
691
737
  - spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_an_API_client_with_no_tokens/caches_a_new_access_token.yml
738
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/does_not_alter_the_configuration.yml
739
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/updates_access_token.yml
740
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_altering_a_custom_option/updates_refresh_token.yml
741
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/does_not_alter_the_configuration.yml
742
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/updates_access_token.yml
743
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_configured_with_custom_options/updates_refresh_token.yml
744
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/does_not_alter_the_configuration.yml
745
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/updates_access_token.yml
746
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_logged_in_previously/updates_refresh_token.yml
747
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_no_config_exists/creates_the_configuration.yml
748
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_no_config_exists/refreshed_tokens.yml
749
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_using_an_email_and_suffix/creates_the_configuration.yml
750
+ - spec/cassettes/Brightbox_BBConfig_add_login/when_using_an_email_and_suffix/refreshed_tokens.yml
692
751
  - spec/cassettes/Brightbox_CloudIP/_find_all_/when_a_Cloud_IP_exists/returns_a_suitable.yml
693
752
  - spec/cassettes/Brightbox_FirewallPolicy/_apply_to/should_apply_firewall_policy.yml
694
753
  - spec/cassettes/Brightbox_FirewallPolicy/_create/should_create_firewall_policy.yml
@@ -758,6 +817,30 @@ test_files:
758
817
  - spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/does_not_output_to_stderr.yml
759
818
  - spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/outputs_table_details_to_stdout.yml
760
819
  - spec/cassettes/brightbox_database-snapshots/show/when_resource_exists/does_not_output_to_stderr.yml
820
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/does_not_error.yml
821
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/does_not_prompt_to_rerun_the_command.yml
822
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/prompts_for_the_password.yml
823
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/requests_access_tokens.yml
824
+ - spec/cassettes/brightbox_login/when_alternative_client_credentials_are_given/sets_up_the_config.yml
825
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/does_not_error.yml
826
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/does_not_prompt_to_rerun_the_command.yml
827
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/prompts_for_the_password.yml
828
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/requests_access_tokens.yml
829
+ - spec/cassettes/brightbox_login/when_custom_api/auth_URLs_are_given/sets_up_the_config.yml
830
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/does_not_error.yml
831
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/does_not_prompt_to_rerun_the_command.yml
832
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/prompts_for_the_password.yml
833
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/requests_access_tokens.yml
834
+ - spec/cassettes/brightbox_login/when_default_account_is_passed/sets_up_the_config.yml
835
+ - spec/cassettes/brightbox_login/when_no_config_is_present/does_not_error.yml
836
+ - spec/cassettes/brightbox_login/when_no_config_is_present/does_not_prompt_to_rerun_the_command.yml
837
+ - spec/cassettes/brightbox_login/when_no_config_is_present/requests_access_tokens.yml
838
+ - spec/cassettes/brightbox_login/when_no_config_is_present/sets_up_the_config.yml
839
+ - spec/cassettes/brightbox_login/when_no_password_is_given/does_not_error.yml
840
+ - spec/cassettes/brightbox_login/when_no_password_is_given/does_not_prompt_to_rerun_the_command.yml
841
+ - spec/cassettes/brightbox_login/when_no_password_is_given/prompts_for_the_password.yml
842
+ - spec/cassettes/brightbox_login/when_no_password_is_given/requests_access_tokens.yml
843
+ - spec/cassettes/brightbox_login/when_no_password_is_given/sets_up_the_config.yml
761
844
  - spec/commands/accounts/default_spec.rb
762
845
  - spec/commands/accounts/list_spec.rb
763
846
  - spec/commands/accounts/reset_ftp_password_spec.rb
@@ -797,6 +880,7 @@ test_files:
797
880
  - spec/commands/lbs/remove_nodes_spec.rb
798
881
  - spec/commands/lbs/show_spec.rb
799
882
  - spec/commands/lbs/update_spec.rb
883
+ - spec/commands/login_spec.rb
800
884
  - spec/commands/policies/apply_spec.rb
801
885
  - spec/commands/policies/create_spec.rb
802
886
  - spec/commands/policies/destroy_spec.rb
@@ -859,6 +943,7 @@ test_files:
859
943
  - spec/unit/brightbox/bb_config/access_token_filename_spec.rb
860
944
  - spec/unit/brightbox/bb_config/access_token_spec.rb
861
945
  - spec/unit/brightbox/bb_config/account_spec.rb
946
+ - spec/unit/brightbox/bb_config/add_login_spec.rb
862
947
  - spec/unit/brightbox/bb_config/add_section_spec.rb
863
948
  - spec/unit/brightbox/bb_config/clear_default_client_spec.rb
864
949
  - spec/unit/brightbox/bb_config/client_alias_spec.rb
@@ -880,6 +965,7 @@ test_files:
880
965
  - spec/unit/brightbox/bb_config/renew_tokens_spec.rb
881
966
  - spec/unit/brightbox/bb_config/save_default_account_spec.rb
882
967
  - spec/unit/brightbox/bb_config/save_spec.rb
968
+ - spec/unit/brightbox/bb_config/section_names_spec.rb
883
969
  - spec/unit/brightbox/bb_config/to_fog_spec.rb
884
970
  - spec/unit/brightbox/bb_config/update_stored_tokens_spec.rb
885
971
  - spec/unit/brightbox/bb_config/using_client_spec.rb
@@ -942,3 +1028,4 @@ test_files:
942
1028
  - spec/unit/ruby_core_ext_spec.rb
943
1029
  - spec/unit/temporary_home_spec.rb
944
1030
  - spec/unit/tmp_config_spec.rb
1031
+ has_rdoc: