fog-brightbox 0.7.1 → 0.7.2
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 +12 -0
- data/lib/fog/brightbox.rb +9 -0
- data/lib/fog/brightbox/config.rb +13 -2
- data/lib/fog/brightbox/models/compute/flavor.rb +1 -1
- data/lib/fog/brightbox/models/compute/server.rb +1 -0
- data/lib/fog/brightbox/oauth2.rb +5 -5
- data/lib/fog/brightbox/storage/connection.rb +5 -5
- data/lib/fog/brightbox/version.rb +1 -1
- data/spec/fog/brightbox/config_spec.rb +16 -0
- data/spec/fog/brightbox/storage/authentication_request_spec.rb +1 -3
- data/spec/fog/storage/brightbox_spec.rb +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19f50dbd6fab54d437c1b83755cbebeba0ae2086
|
4
|
+
data.tar.gz: a4005908605f1d2fc9a754eb9250644ddc59fa08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cafa999266123be2945077625739f96c9f63c207788ad6f4f4ff1ec6026dec89edea3c94d399dbec6066fd18a18ce2b514ee83b4e199082781e2279373b839d5
|
7
|
+
data.tar.gz: 1a0f45971ad2c886ad0eb6c532431e604e1303bddbc88781ed024009ddb6df82990e15e4300f26cc2d1e7974d31f30c47f43e653d89117f130642661f032325f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### 0.7.2 / 2015-06-25
|
2
|
+
|
3
|
+
Bug fixes:
|
4
|
+
|
5
|
+
* Error if management URL is not `URI` to prevent errors when a `String` given.
|
6
|
+
* `Server#bits` returns "64" as a placeholder rather than "0".
|
7
|
+
* Fixed requires in specs so can they can all run independently.
|
8
|
+
|
9
|
+
Changes:
|
10
|
+
|
11
|
+
* Fixed some indentation problems.
|
12
|
+
|
1
13
|
### 0.7.1 / 2014-12-05
|
2
14
|
|
3
15
|
Bug fixes:
|
data/lib/fog/brightbox.rb
CHANGED
@@ -1,2 +1,11 @@
|
|
1
|
+
# See the main fog gem for more details about the top level class {Fog}
|
2
|
+
#
|
3
|
+
# @see https://github.com/fog/fog
|
4
|
+
# @see http://fog.io/
|
5
|
+
# @see http://rubydoc.info/gems/fog
|
6
|
+
#
|
7
|
+
module Fog
|
8
|
+
end
|
9
|
+
|
1
10
|
require "fog/brightbox/compute"
|
2
11
|
require "fog/brightbox/storage"
|
data/lib/fog/brightbox/config.rb
CHANGED
@@ -9,8 +9,6 @@ module Fog
|
|
9
9
|
# is told a token has expired then another will not retry it.
|
10
10
|
#
|
11
11
|
class Config
|
12
|
-
attr_writer :storage_management_url
|
13
|
-
|
14
12
|
# Creates a new set of configuration settings based on the options provided.
|
15
13
|
#
|
16
14
|
# @param [Hash] options The configuration settings
|
@@ -94,6 +92,12 @@ module Fog
|
|
94
92
|
URI.parse(@options[:brightbox_storage_url] || "https://orbit.brightbox.com")
|
95
93
|
end
|
96
94
|
|
95
|
+
# The {#storage_management_url} is based on the {#storage_url} and the account details used when
|
96
|
+
# autheticating. This is normally automatically discovered within the servive but can be
|
97
|
+
# overridden in the {Config}
|
98
|
+
#
|
99
|
+
# @return [URI] if the URL is configured
|
100
|
+
# @return [nil] if the URL is not configured
|
97
101
|
def storage_management_url
|
98
102
|
@storage_management_url ||= if @options.key?(:brightbox_storage_management_url)
|
99
103
|
URI.parse(@options[:brightbox_storage_management_url])
|
@@ -102,6 +106,13 @@ module Fog
|
|
102
106
|
end
|
103
107
|
end
|
104
108
|
|
109
|
+
# @param [URI] management_url The +URI+ to use for management requests.
|
110
|
+
# @raise [ArgumentError] if non +URI+ object passed
|
111
|
+
def storage_management_url=(management_url)
|
112
|
+
raise ArgumentError unless management_url.kind_of?(URI)
|
113
|
+
@storage_management_url = management_url
|
114
|
+
end
|
115
|
+
|
105
116
|
# @return [String] The configured identifier of the API client or user application.
|
106
117
|
def client_id
|
107
118
|
@options[:brightbox_client_id]
|
data/lib/fog/brightbox/oauth2.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
# This module covers Brightbox's partial implementation of OAuth 2.0
|
2
|
-
# and enables fog clients to implement several authentictication strategies
|
3
|
-
#
|
4
|
-
# @see http://tools.ietf.org/html/draft-ietf-oauth-v2-10
|
5
|
-
#
|
6
1
|
module Fog
|
7
2
|
module Brightbox
|
3
|
+
# This module covers Brightbox's partial implementation of OAuth 2.0
|
4
|
+
# and enables fog clients to implement several authentictication strategies
|
5
|
+
#
|
6
|
+
# @see http://tools.ietf.org/html/draft-ietf-oauth-v2-10
|
7
|
+
#
|
8
8
|
module OAuth2
|
9
9
|
# This builds the simplest form of requesting an access token
|
10
10
|
# based on the arguments passed in
|
@@ -19,9 +19,9 @@ module Fog
|
|
19
19
|
begin
|
20
20
|
raise ArgumentError if params.nil?
|
21
21
|
request_params = params.merge(
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
:headers => request_headers(params),
|
23
|
+
:path => path_in_params(params)
|
24
|
+
)
|
25
25
|
response = @connection.request(request_params)
|
26
26
|
rescue Excon::Errors::Unauthorized => error
|
27
27
|
raise AuthenticationRequired.slurp(error)
|
@@ -59,8 +59,8 @@ module Fog
|
|
59
59
|
|
60
60
|
def authenticated_headers
|
61
61
|
default_headers.merge(
|
62
|
-
|
63
|
-
|
62
|
+
"X-Auth-Token" => @config.latest_access_token
|
63
|
+
)
|
64
64
|
end
|
65
65
|
|
66
66
|
def default_headers
|
@@ -238,4 +238,20 @@ describe Fog::Brightbox::Config do
|
|
238
238
|
refute @config.user_credentials?
|
239
239
|
end
|
240
240
|
end
|
241
|
+
|
242
|
+
describe "when setting management_url with URI" do
|
243
|
+
it "sets it correctly" do
|
244
|
+
uri = URI.parse("https://example.com")
|
245
|
+
@config = Fog::Brightbox::Config.new
|
246
|
+
@config.storage_management_url = uri
|
247
|
+
assert_equal @config.storage_management_url, uri
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
describe "when setting management_url with String" do
|
252
|
+
it "raises ArgumentError" do
|
253
|
+
uri = "http://example.com/wrong"
|
254
|
+
assert_raises(ArgumentError) { Fog::Brightbox::Config.new.storage_management_url = uri }
|
255
|
+
end
|
256
|
+
end
|
241
257
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-brightbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Thornthwaite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -398,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
398
398
|
version: '0'
|
399
399
|
requirements: []
|
400
400
|
rubyforge_project:
|
401
|
-
rubygems_version: 2.
|
401
|
+
rubygems_version: 2.4.5
|
402
402
|
signing_key:
|
403
403
|
specification_version: 4
|
404
404
|
summary: This library can be used as a module for `fog` or as standalone provider
|