brightbox-cli 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.brightbox.dev/token
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"grant_type":"password","username":"jason.null@brightbox.com","password":"N:B3e%7Cmh"}'
9
+ headers:
10
+ User-Agent:
11
+ - fog-core/1.32.1
12
+ Authorization:
13
+ - Basic YXBwLTEyMzQ1Om1vY2J1aXBiaWFhNms2Yw==
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ Content-Type:
22
+ - application/json
23
+ Cache-Control:
24
+ - no-store
25
+ X-Oauth-Scopes:
26
+ - infrastructure, orbit
27
+ Content-Length:
28
+ - '190'
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Ua-Compatible:
32
+ - IE=Edge
33
+ Etag:
34
+ - '"52cf652e4c8197b06a5df541b6c6e6b6"'
35
+ X-Request-Id:
36
+ - c41fe56cfea4d84c928af11c4ad27b60
37
+ X-Runtime:
38
+ - '0.086987'
39
+ Server:
40
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
41
+ Date:
42
+ - Mon, 12 Oct 2015 11:34:18 GMT
43
+ Connection:
44
+ - Keep-Alive
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"access_token":"cd64dd737e020f9975a97c35e78e27e46442eb27","token_type":"Bearer","refresh_token":"00114bd8f6aa955911870efbb5f8b135dc6fc9c5","scope":"infrastructure,
48
+ orbit","expires_in":7200}'
49
+ http_version:
50
+ recorded_at: Mon, 12 Oct 2015 11:34:18 GMT
51
+ - request:
52
+ method: get
53
+ uri: http://api.brightbox.dev/1.0/accounts
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ User-Agent:
59
+ - fog-core/1.32.1
60
+ Authorization:
61
+ - Bearer cd64dd737e020f9975a97c35e78e27e46442eb27
62
+ Content-Type:
63
+ - application/json
64
+ response:
65
+ status:
66
+ code: 200
67
+ message:
68
+ headers:
69
+ X-Oauth-Scopes:
70
+ - infrastructure, orbit
71
+ Content-Type:
72
+ - application/json; charset=utf-8
73
+ X-Ua-Compatible:
74
+ - IE=Edge
75
+ Etag:
76
+ - '"c9a269456e92ca15ff834e08ba6414ad"'
77
+ Cache-Control:
78
+ - max-age=0, private, must-revalidate
79
+ X-Request-Id:
80
+ - f4dde3adcaecea5e4df8f56927b328b5
81
+ X-Runtime:
82
+ - '0.044869'
83
+ Server:
84
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
85
+ Date:
86
+ - Mon, 12 Oct 2015 11:34:18 GMT
87
+ Content-Length:
88
+ - '1611'
89
+ Connection:
90
+ - Keep-Alive
91
+ body:
92
+ encoding: UTF-8
93
+ string: '[{"id":"acc-12345","resource_type":"account","url":"https://api.gb1.brightbox.com/1.0/accounts/acc-12345","name":"CLI
94
+ test account","status":"active","ram_limit":3200000,"ram_used":0,"dbs_ram_limit":32768,"dbs_ram_used":0,"cloud_ips_limit":32,"cloud_ips_used":0,"load_balancers_limit":5,"load_balancers_used":0,"clients":[{"id":"cli-12345","resource_type":"api_client","url":"https://api.gb1.brightbox.com/1.0/api_clients/cli-12345","name":"CLI
95
+ test API client","description":"","revoked_at":null,"permissions_group":"full"}],"images":[],"servers":[],"load_balancers":[],"database_servers":[],"database_snapshots":[],"cloud_ips":[],"server_groups":[{"id":"grp-12345","resource_type":"server_group","url":"https://api.gb1.brightbox.com/1.0/server_groups/grp-12345","name":"default","description":"All
96
+ new servers are added to this group unless specified otherwise.","created_at":"2015-10-12T09:23:03Z","default":true}],"firewall_policies":[{"id":"fwp-12345","resource_type":"firewall_policy","url":"https://api.gb1.brightbox.com/1.0/firewall_policies/fwp-12345","default":true,"name":"default","created_at":"2015-10-12T09:23:03Z","description":"Applied
97
+ to the default server group."}],"owner":{"id":"usr-12345","resource_type":"user","url":"https://api.gb1.brightbox.com/1.0/users/usr-12345","name":"Jason
98
+ Null","email_address":"jason.null@brightbox.com"},"users":[],"zones":[{"id":"zon-12345","resource_type":"zone","url":"https://api.gb1.brightbox.com/1.0/zones/zon-12345","handle":"gb1-a"},{"id":"zon-12345","resource_type":"zone","url":"https://api.gb1.brightbox.com/1.0/zones/zon-12345","handle":"gb1-b"}]}]'
99
+ http_version:
100
+ recorded_at: Mon, 12 Oct 2015 11:34:18 GMT
101
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.brightbox.dev/token
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"grant_type":"password","username":"jason.null@brightbox.com","password":"N:B3e%7Cmh"}'
9
+ headers:
10
+ User-Agent:
11
+ - fog-core/1.32.1
12
+ Authorization:
13
+ - Basic YXBwLTEyMzQ1Om1vY2J1aXBiaWFhNms2Yw==
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ Content-Type:
22
+ - application/json
23
+ Cache-Control:
24
+ - no-store
25
+ X-Oauth-Scopes:
26
+ - infrastructure, orbit
27
+ Content-Length:
28
+ - '190'
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Ua-Compatible:
32
+ - IE=Edge
33
+ Etag:
34
+ - '"7c6c299200a760215ff6d635fbfb87fa"'
35
+ X-Request-Id:
36
+ - 25a83af3475513c26604a8e675a2694f
37
+ X-Runtime:
38
+ - '0.169489'
39
+ Server:
40
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
41
+ Date:
42
+ - Mon, 12 Oct 2015 11:34:18 GMT
43
+ Connection:
44
+ - Keep-Alive
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"access_token":"f1d7a05784f9bea5060fbcc4a9a46d5b6cf05dbe","token_type":"Bearer","refresh_token":"5b891e0affc1fa7d9e5462482e07f6bf3c0ad21f","scope":"infrastructure,
48
+ orbit","expires_in":7200}'
49
+ http_version:
50
+ recorded_at: Mon, 12 Oct 2015 11:34:18 GMT
51
+ - request:
52
+ method: get
53
+ uri: http://api.brightbox.dev/1.0/accounts
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ User-Agent:
59
+ - fog-core/1.32.1
60
+ Authorization:
61
+ - Bearer f1d7a05784f9bea5060fbcc4a9a46d5b6cf05dbe
62
+ Content-Type:
63
+ - application/json
64
+ response:
65
+ status:
66
+ code: 200
67
+ message:
68
+ headers:
69
+ X-Oauth-Scopes:
70
+ - infrastructure, orbit
71
+ Content-Type:
72
+ - application/json; charset=utf-8
73
+ X-Ua-Compatible:
74
+ - IE=Edge
75
+ Etag:
76
+ - '"c9a269456e92ca15ff834e08ba6414ad"'
77
+ Cache-Control:
78
+ - max-age=0, private, must-revalidate
79
+ X-Request-Id:
80
+ - bec97c1b2f65ab03e869ba79280b3f0c
81
+ X-Runtime:
82
+ - '0.045946'
83
+ Server:
84
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
85
+ Date:
86
+ - Mon, 12 Oct 2015 11:34:18 GMT
87
+ Content-Length:
88
+ - '1611'
89
+ Connection:
90
+ - Keep-Alive
91
+ body:
92
+ encoding: UTF-8
93
+ string: '[{"id":"acc-12345","resource_type":"account","url":"https://api.gb1.brightbox.com/1.0/accounts/acc-12345","name":"CLI
94
+ test account","status":"active","ram_limit":3200000,"ram_used":0,"dbs_ram_limit":32768,"dbs_ram_used":0,"cloud_ips_limit":32,"cloud_ips_used":0,"load_balancers_limit":5,"load_balancers_used":0,"clients":[{"id":"cli-12345","resource_type":"api_client","url":"https://api.gb1.brightbox.com/1.0/api_clients/cli-12345","name":"CLI
95
+ test API client","description":"","revoked_at":null,"permissions_group":"full"}],"images":[],"servers":[],"load_balancers":[],"database_servers":[],"database_snapshots":[],"cloud_ips":[],"server_groups":[{"id":"grp-12345","resource_type":"server_group","url":"https://api.gb1.brightbox.com/1.0/server_groups/grp-12345","name":"default","description":"All
96
+ new servers are added to this group unless specified otherwise.","created_at":"2015-10-12T09:23:03Z","default":true}],"firewall_policies":[{"id":"fwp-12345","resource_type":"firewall_policy","url":"https://api.gb1.brightbox.com/1.0/firewall_policies/fwp-12345","default":true,"name":"default","created_at":"2015-10-12T09:23:03Z","description":"Applied
97
+ to the default server group."}],"owner":{"id":"usr-12345","resource_type":"user","url":"https://api.gb1.brightbox.com/1.0/users/usr-12345","name":"Jason
98
+ Null","email_address":"jason.null@brightbox.com"},"users":[],"zones":[{"id":"zon-12345","resource_type":"zone","url":"https://api.gb1.brightbox.com/1.0/zones/zon-12345","handle":"gb1-a"},{"id":"zon-12345","resource_type":"zone","url":"https://api.gb1.brightbox.com/1.0/zones/zon-12345","handle":"gb1-b"}]}]'
99
+ http_version:
100
+ recorded_at: Mon, 12 Oct 2015 11:34:18 GMT
101
+ recorded_with: VCR 2.5.0
@@ -16,7 +16,7 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 401
19
- message:
19
+ message:
20
20
  headers:
21
21
  WWW-Authenticate:
22
22
  - OAuth error="invalid_token"
@@ -38,7 +38,7 @@ http_interactions:
38
38
  encoding: UTF-8
39
39
  string: '{"error":"invalid_token","error_description":"The OAuth token can not
40
40
  be found"}'
41
- http_version:
41
+ http_version:
42
42
  recorded_at: Wed, 28 Aug 2013 14:50:08 GMT
43
43
  - request:
44
44
  method: post
@@ -56,7 +56,7 @@ http_interactions:
56
56
  response:
57
57
  status:
58
58
  code: 400
59
- message:
59
+ message:
60
60
  headers:
61
61
  X-Frame-Options:
62
62
  - sameorigin
@@ -84,7 +84,7 @@ http_interactions:
84
84
  provided is invalid, the client failed to authenticate, the client did not
85
85
  include its credentials, provided multiple client credentials, or used unsupported
86
86
  credentials type."}'
87
- http_version:
87
+ http_version:
88
88
  recorded_at: Wed, 28 Aug 2013 14:50:08 GMT
89
89
  - request:
90
90
  method: get
@@ -102,7 +102,7 @@ http_interactions:
102
102
  response:
103
103
  status:
104
104
  code: 401
105
- message:
105
+ message:
106
106
  headers:
107
107
  WWW-Authenticate:
108
108
  - OAuth error="invalid_token"
@@ -124,7 +124,7 @@ http_interactions:
124
124
  encoding: UTF-8
125
125
  string: '{"error":"invalid_token","error_description":"The OAuth token can not
126
126
  be found"}'
127
- http_version:
127
+ http_version:
128
128
  recorded_at: Wed, 28 Aug 2013 14:50:08 GMT
129
129
  - request:
130
130
  method: post
@@ -142,7 +142,7 @@ http_interactions:
142
142
  response:
143
143
  status:
144
144
  code: 200
145
- message:
145
+ message:
146
146
  headers:
147
147
  X-Frame-Options:
148
148
  - sameorigin
@@ -169,7 +169,7 @@ http_interactions:
169
169
  body:
170
170
  encoding: UTF-8
171
171
  string: '{"access_token":"d003e4f0970b948af8e35d3ed9f3531cdd6e2154","expires_in":7200,"refresh_token":"dcd32790159f852756dadf8bed12cc3369c7b448"}'
172
- http_version:
172
+ http_version:
173
173
  recorded_at: Wed, 28 Aug 2013 14:50:09 GMT
174
174
  - request:
175
175
  method: post
@@ -187,7 +187,7 @@ http_interactions:
187
187
  response:
188
188
  status:
189
189
  code: 400
190
- message:
190
+ message:
191
191
  headers:
192
192
  X-Frame-Options:
193
193
  - sameorigin
@@ -215,7 +215,7 @@ http_interactions:
215
215
  provided is invalid, the client failed to authenticate, the client did not
216
216
  include its credentials, provided multiple client credentials, or used unsupported
217
217
  credentials type."}'
218
- http_version:
218
+ http_version:
219
219
  recorded_at: Wed, 28 Aug 2013 14:54:24 GMT
220
220
  - request:
221
221
  method: post
@@ -233,7 +233,7 @@ http_interactions:
233
233
  response:
234
234
  status:
235
235
  code: 400
236
- message:
236
+ message:
237
237
  headers:
238
238
  X-Frame-Options:
239
239
  - sameorigin
@@ -259,7 +259,7 @@ http_interactions:
259
259
  encoding: UTF-8
260
260
  string: '{"error":"unauthorized_client","error_description":"The authenticated
261
261
  client is not authorized to use the access grant type provided."}'
262
- http_version:
262
+ http_version:
263
263
  recorded_at: Wed, 18 Sep 2013 15:18:57 GMT
264
264
  - request:
265
265
  method: post
@@ -277,7 +277,7 @@ http_interactions:
277
277
  response:
278
278
  status:
279
279
  code: 400
280
- message:
280
+ message:
281
281
  headers:
282
282
  X-Frame-Options:
283
283
  - sameorigin
@@ -303,7 +303,7 @@ http_interactions:
303
303
  encoding: UTF-8
304
304
  string: '{"error":"unauthorized_client","error_description":"The authenticated
305
305
  client is not authorized to use the access grant type provided."}'
306
- http_version:
306
+ http_version:
307
307
  recorded_at: Wed, 18 Sep 2013 15:18:57 GMT
308
308
  - request:
309
309
  method: post
@@ -321,7 +321,7 @@ http_interactions:
321
321
  response:
322
322
  status:
323
323
  code: 400
324
- message:
324
+ message:
325
325
  headers:
326
326
  X-Frame-Options:
327
327
  - sameorigin
@@ -349,7 +349,7 @@ http_interactions:
349
349
  is invalid, expired, or revoked (e.g. invalid assertion, expired authorization
350
350
  token, bad end-user password credentials, or mismatching authorization code
351
351
  and redirection URI)."}'
352
- http_version:
352
+ http_version:
353
353
  recorded_at: Wed, 18 Sep 2013 15:19:02 GMT
354
354
  - request:
355
355
  method: post
@@ -367,7 +367,7 @@ http_interactions:
367
367
  response:
368
368
  status:
369
369
  code: 401
370
- message:
370
+ message:
371
371
  headers:
372
372
  X-Frame-Options:
373
373
  - sameorigin
@@ -394,6 +394,52 @@ http_interactions:
394
394
  body:
395
395
  encoding: UTF-8
396
396
  string: '{"error":"invalid_client"}'
397
- http_version:
397
+ http_version:
398
398
  recorded_at: Wed, 18 Sep 2013 15:19:35 GMT
399
+ - request:
400
+ method: post
401
+ uri: http://api.brightbox.dev/token
402
+ body:
403
+ encoding: UTF-8
404
+ string: '{"grant_type":"refresh_token","refresh_token":"6846e655733a4fc36913c6c7e7bf8cb8fe7940b8"}'
405
+ headers:
406
+ User-Agent:
407
+ - fog-core/1.32.1
408
+ Authorization:
409
+ - Basic YXBwLTEyMzQ1Om1vY2J1aXBiaWFhNms2Yw==
410
+ Content-Type:
411
+ - application/json
412
+ response:
413
+ status:
414
+ code: 400
415
+ message:
416
+ headers:
417
+ Content-Type:
418
+ - application/json
419
+ Cache-Control:
420
+ - no-store
421
+ Content-Length:
422
+ - '250'
423
+ X-Content-Type-Options:
424
+ - nosniff
425
+ X-Ua-Compatible:
426
+ - IE=Edge
427
+ X-Request-Id:
428
+ - 971f3fc1ae009572f5d2cef69846285a
429
+ X-Runtime:
430
+ - '0.435538'
431
+ Server:
432
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
433
+ Date:
434
+ - Mon, 19 Oct 2015 15:08:07 GMT
435
+ Connection:
436
+ - Keep-Alive
437
+ body:
438
+ encoding: UTF-8
439
+ string: '{"error":"invalid_grant","error_description":"The provided access grant
440
+ is invalid, expired, or revoked (e.g. invalid assertion, expired authorization
441
+ token, bad end-user password credentials, or mismatching authorization code
442
+ and redirection URI)."}'
443
+ http_version:
444
+ recorded_at: Mon, 19 Oct 2015 15:08:07 GMT
399
445
  recorded_with: VCR 2.5.0
@@ -16,7 +16,7 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 400
19
- message:
19
+ message:
20
20
  headers:
21
21
  X-Frame-Options:
22
22
  - sameorigin
@@ -42,7 +42,7 @@ http_interactions:
42
42
  encoding: UTF-8
43
43
  string: '{"error":"unauthorized_client","error_description":"The authenticated
44
44
  client is not authorized to use the access grant type provided."}'
45
- http_version:
45
+ http_version:
46
46
  recorded_at: Tue, 27 Aug 2013 15:11:59 GMT
47
47
  - request:
48
48
  method: get
@@ -60,7 +60,7 @@ http_interactions:
60
60
  response:
61
61
  status:
62
62
  code: 401
63
- message:
63
+ message:
64
64
  headers:
65
65
  WWW-Authenticate:
66
66
  - OAuth error="invalid_token"
@@ -82,7 +82,7 @@ http_interactions:
82
82
  encoding: UTF-8
83
83
  string: '{"error":"invalid_token","error_description":"The OAuth token can not
84
84
  be found"}'
85
- http_version:
85
+ http_version:
86
86
  recorded_at: Tue, 27 Aug 2013 15:11:59 GMT
87
87
  - request:
88
88
  method: post
@@ -100,7 +100,7 @@ http_interactions:
100
100
  response:
101
101
  status:
102
102
  code: 400
103
- message:
103
+ message:
104
104
  headers:
105
105
  X-Frame-Options:
106
106
  - sameorigin
@@ -126,7 +126,7 @@ http_interactions:
126
126
  encoding: UTF-8
127
127
  string: '{"error":"unauthorized_client","error_description":"The authenticated
128
128
  client is not authorized to use the access grant type provided."}'
129
- http_version:
129
+ http_version:
130
130
  recorded_at: Tue, 27 Aug 2013 15:11:59 GMT
131
131
  - request:
132
132
  method: get
@@ -144,7 +144,7 @@ http_interactions:
144
144
  response:
145
145
  status:
146
146
  code: 401
147
- message:
147
+ message:
148
148
  headers:
149
149
  WWW-Authenticate:
150
150
  - OAuth error="invalid_token"
@@ -166,7 +166,7 @@ http_interactions:
166
166
  encoding: UTF-8
167
167
  string: '{"error":"invalid_token","error_description":"The OAuth token can not
168
168
  be found"}'
169
- http_version:
169
+ http_version:
170
170
  recorded_at: Tue, 27 Aug 2013 15:11:59 GMT
171
171
  - request:
172
172
  method: post
@@ -184,7 +184,7 @@ http_interactions:
184
184
  response:
185
185
  status:
186
186
  code: 200
187
- message:
187
+ message:
188
188
  headers:
189
189
  X-Frame-Options:
190
190
  - sameorigin
@@ -211,7 +211,7 @@ http_interactions:
211
211
  body:
212
212
  encoding: UTF-8
213
213
  string: '{"access_token":"cf9d63fa39bf6f7bedad62c461f020e92d8f1e44","expires_in":7200,"refresh_token":"7b574d091da700939a4cebcd1938ad4b547b1d00"}'
214
- http_version:
214
+ http_version:
215
215
  recorded_at: Tue, 27 Aug 2013 15:11:59 GMT
216
216
  - request:
217
217
  method: post
@@ -229,7 +229,7 @@ http_interactions:
229
229
  response:
230
230
  status:
231
231
  code: 200
232
- message:
232
+ message:
233
233
  headers:
234
234
  X-Frame-Options:
235
235
  - sameorigin
@@ -256,7 +256,7 @@ http_interactions:
256
256
  body:
257
257
  encoding: UTF-8
258
258
  string: '{"access_token":"e75c77ba85740b2d572e15bbe75595ffc7f5814a","expires_in":7200}'
259
- http_version:
259
+ http_version:
260
260
  recorded_at: Tue, 27 Aug 2013 16:54:19 GMT
261
261
  - request:
262
262
  method: post
@@ -274,7 +274,7 @@ http_interactions:
274
274
  response:
275
275
  status:
276
276
  code: 200
277
- message:
277
+ message:
278
278
  headers:
279
279
  X-Frame-Options:
280
280
  - sameorigin
@@ -301,7 +301,7 @@ http_interactions:
301
301
  body:
302
302
  encoding: UTF-8
303
303
  string: '{"access_token":"7e65f560ecbca978f15131faa5071d120b9986f2","expires_in":7200}'
304
- http_version:
304
+ http_version:
305
305
  recorded_at: Wed, 28 Aug 2013 08:50:46 GMT
306
306
  - request:
307
307
  method: post
@@ -319,7 +319,7 @@ http_interactions:
319
319
  response:
320
320
  status:
321
321
  code: 400
322
- message:
322
+ message:
323
323
  headers:
324
324
  X-Frame-Options:
325
325
  - sameorigin
@@ -347,6 +347,52 @@ http_interactions:
347
347
  is invalid, expired, or revoked (e.g. invalid assertion, expired authorization
348
348
  token, bad end-user password credentials, or mismatching authorization code
349
349
  and redirection URI)."}'
350
- http_version:
350
+ http_version:
351
351
  recorded_at: Wed, 18 Sep 2013 15:15:36 GMT
352
+ - request:
353
+ method: post
354
+ uri: http://api.brightbox.dev/token
355
+ body:
356
+ encoding: UTF-8
357
+ string: '{"grant_type":"refresh_token","refresh_token":"305ae4a60568a02d606744372dc7b8a2b80d7a8e"}'
358
+ headers:
359
+ User-Agent:
360
+ - fog-core/1.32.1
361
+ Authorization:
362
+ - Basic YXBwLTEyMzQ1Om1vY2J1aXBiaWFhNms2Yw==
363
+ Content-Type:
364
+ - application/json
365
+ response:
366
+ status:
367
+ code: 400
368
+ message:
369
+ headers:
370
+ Content-Type:
371
+ - application/json
372
+ Cache-Control:
373
+ - no-store
374
+ Content-Length:
375
+ - '250'
376
+ X-Content-Type-Options:
377
+ - nosniff
378
+ X-Ua-Compatible:
379
+ - IE=Edge
380
+ X-Request-Id:
381
+ - 135237d4586256c6c21c2a0ad64399d2
382
+ X-Runtime:
383
+ - '0.012657'
384
+ Server:
385
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
386
+ Date:
387
+ - Mon, 19 Oct 2015 15:46:27 GMT
388
+ Connection:
389
+ - Keep-Alive
390
+ body:
391
+ encoding: UTF-8
392
+ string: '{"error":"invalid_grant","error_description":"The provided access grant
393
+ is invalid, expired, or revoked (e.g. invalid assertion, expired authorization
394
+ token, bad end-user password credentials, or mismatching authorization code
395
+ and redirection URI)."}'
396
+ http_version:
397
+ recorded_at: Mon, 19 Oct 2015 15:46:27 GMT
352
398
  recorded_with: VCR 2.5.0
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.brightbox.dev/token
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"grant_type":"password","username":"jason.null@brightbox.com","password":"N:B3e%7Cmh"}'
9
+ headers:
10
+ User-Agent:
11
+ - fog-core/1.32.1
12
+ Authorization:
13
+ - Basic YXBwLTEyMzQ1Om1vY2J1aXBiaWFhNms2Yw==
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ Content-Type:
22
+ - application/json
23
+ Cache-Control:
24
+ - no-store
25
+ X-Oauth-Scopes:
26
+ - infrastructure, orbit
27
+ Content-Length:
28
+ - '190'
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ X-Ua-Compatible:
32
+ - IE=Edge
33
+ Etag:
34
+ - '"8427a5b33563d107f36f432b571b1aea"'
35
+ X-Request-Id:
36
+ - a69ad322d55ff6ef493a47eca023909d
37
+ X-Runtime:
38
+ - '0.087780'
39
+ Server:
40
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
41
+ Date:
42
+ - Mon, 12 Oct 2015 14:53:53 GMT
43
+ Connection:
44
+ - Keep-Alive
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"access_token":"44320b29286077c44f14c4efdfed70f63f4a8361","token_type":"Bearer","refresh_token":"759b2b28c228948a0ba5d07a89f39f9e268a95c0","scope":"infrastructure,
48
+ orbit","expires_in":7200}'
49
+ http_version:
50
+ recorded_at: Mon, 12 Oct 2015 14:53:53 GMT
51
+ - request:
52
+ method: get
53
+ uri: http://api.brightbox.dev/1.0/accounts
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ''
57
+ headers:
58
+ User-Agent:
59
+ - fog-core/1.32.1
60
+ Authorization:
61
+ - Bearer 44320b29286077c44f14c4efdfed70f63f4a8361
62
+ Content-Type:
63
+ - application/json
64
+ response:
65
+ status:
66
+ code: 200
67
+ message:
68
+ headers:
69
+ X-Oauth-Scopes:
70
+ - infrastructure, orbit
71
+ Content-Type:
72
+ - application/json; charset=utf-8
73
+ X-Ua-Compatible:
74
+ - IE=Edge
75
+ Etag:
76
+ - '"c9a269456e92ca15ff834e08ba6414ad"'
77
+ Cache-Control:
78
+ - max-age=0, private, must-revalidate
79
+ X-Request-Id:
80
+ - 673b66619adee67e28f49368f32c6ffa
81
+ X-Runtime:
82
+ - '0.126722'
83
+ Server:
84
+ - WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13)
85
+ Date:
86
+ - Mon, 12 Oct 2015 14:53:53 GMT
87
+ Content-Length:
88
+ - '1611'
89
+ Connection:
90
+ - Keep-Alive
91
+ body:
92
+ encoding: UTF-8
93
+ string: '[{"id":"acc-12345","resource_type":"account","url":"https://api.gb1.brightbox.com/1.0/accounts/acc-12345","name":"CLI
94
+ test account","status":"active","ram_limit":3200000,"ram_used":0,"dbs_ram_limit":32768,"dbs_ram_used":0,"cloud_ips_limit":32,"cloud_ips_used":0,"load_balancers_limit":5,"load_balancers_used":0,"clients":[{"id":"cli-12345","resource_type":"api_client","url":"https://api.gb1.brightbox.com/1.0/api_clients/cli-12345","name":"CLI
95
+ test API client","description":"","revoked_at":null,"permissions_group":"full"}],"images":[],"servers":[],"load_balancers":[],"database_servers":[],"database_snapshots":[],"cloud_ips":[],"server_groups":[{"id":"grp-12345","resource_type":"server_group","url":"https://api.gb1.brightbox.com/1.0/server_groups/grp-12345","name":"default","description":"All
96
+ new servers are added to this group unless specified otherwise.","created_at":"2015-10-12T09:23:03Z","default":true}],"firewall_policies":[{"id":"fwp-12345","resource_type":"firewall_policy","url":"https://api.gb1.brightbox.com/1.0/firewall_policies/fwp-12345","default":true,"name":"default","created_at":"2015-10-12T09:23:03Z","description":"Applied
97
+ to the default server group."}],"owner":{"id":"usr-12345","resource_type":"user","url":"https://api.gb1.brightbox.com/1.0/users/usr-12345","name":"Jason
98
+ Null","email_address":"jason.null@brightbox.com"},"users":[],"zones":[{"id":"zon-12345","resource_type":"zone","url":"https://api.gb1.brightbox.com/1.0/zones/zon-12345","handle":"gb1-a"},{"id":"zon-12345","resource_type":"zone","url":"https://api.gb1.brightbox.com/1.0/zones/zon-12345","handle":"gb1-b"}]}]'
99
+ http_version:
100
+ recorded_at: Mon, 12 Oct 2015 14:53:53 GMT
101
+ recorded_with: VCR 2.5.0