cifrado 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a5a0c02f4d962d3ae89d56e154d44c16dab7348
4
- data.tar.gz: 691d6fe9a5b52577dcb7050d90a82acea095423d
3
+ metadata.gz: f0746da846ed77bb7954fa0285936c7fcc391871
4
+ data.tar.gz: 646ed7ce8284059a364373c443d00957b415bd8d
5
5
  SHA512:
6
- metadata.gz: dfe0187897d4e05c9af29dbffb9db76631e331872fdcf42a1f6df466ca63652e0406c3cadcad1f30e360be0ee620d8955cf55e953fc71d658e5cb674deb5e0d1
7
- data.tar.gz: c8a0fbe0bc4c26734f99513c66256202235dd45a8bd3081e3ca7d1ac8100cc1071d81ce1ecf7c7f3455c219ab73f78c11087a777600206fc9d6f62daebc2ab4a
6
+ metadata.gz: 099631ccabe814128d9cdd920761d5f930ce454bb85c9e6b97903c0449f4cf40fde243ec2f25e2408314c2a646d6a2570e07f55d0ed4ac839fc8de8c9b79739e
7
+ data.tar.gz: 78b659ca0e2f3794f39f365bcfdfc2f24a0e4dd6902587bd9463ad4bb1bdaa8bdff0e3517db7094385648a5ab0e2c291ea64822a51786a5e79bbc22b2a53ec95
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # Cifrado 0.1.3 - Tue 05 Mar 2013
2
+
3
+ * Fix regresion in the last release that may break regular OpenStack accounts
4
+ * Added version command
5
+
1
6
  # Cifrado 0.1.2 - Mon 04 Mar 2013
2
7
 
3
8
  * Added Rackspace Cloud Files support
@@ -0,0 +1,8 @@
1
+ module Cifrado
2
+ class CLI
3
+ desc 'version', 'Print Cifrado version'
4
+ def version
5
+ Log.info Cifrado::VERSION
6
+ end
7
+ end
8
+ end
data/lib/cifrado/cli.rb CHANGED
@@ -88,14 +88,19 @@ module Cifrado
88
88
  end
89
89
  end
90
90
 
91
- if (config[:auth_url] !~ /rackspacecloud\.com/) and config[:tenant].nil?
92
- Log.error "tenant not provided."
93
- Log.error "Use --tenant option or run 'cifrado setup' first."
94
- raise "Missing tenant"
95
- else
91
+ if config[:auth_url] =~ /rackspacecloud\.com/
92
+ Log.debug "Rackspace Authentication, removing tenant."
96
93
  # Make sure tenant is nil for Rackspace
97
94
  # otherwise we get a service catalog without cloudFiles endpoints
98
95
  config[:tenant] = nil
96
+ else
97
+ if config[:tenant].nil?
98
+ Log.error "Tenant not provided."
99
+ Log.error "Use --tenant option or run 'cifrado setup' first."
100
+ raise "Missing tenant"
101
+ else
102
+ Log.debug "OpenStack regular authentication, using tenant name."
103
+ end
99
104
  end
100
105
 
101
106
  unless config[:secure_random]
@@ -119,6 +124,7 @@ require 'cifrado/cli/set_acl'
119
124
  require 'cifrado/cli/jukebox'
120
125
  require 'cifrado/cli/cinema'
121
126
  require 'cifrado/cli/saio'
127
+ require 'cifrado/cli/version'
122
128
 
123
129
  at_exit do
124
130
  include Cifrado::Utils
@@ -1,3 +1,3 @@
1
1
  module Cifrado
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -57,6 +57,16 @@ module Fog
57
57
  def reset_data
58
58
  self.class.data.delete(@openstack_username)
59
59
  end
60
+
61
+ def change_account(account)
62
+ @original_path ||= @path
63
+ version_string = @original_path.split('/')[1]
64
+ @path = "/#{version_string}/#{account}"
65
+ end
66
+
67
+ def reset_account_name
68
+ @path = @original_path
69
+ end
60
70
 
61
71
  end
62
72
 
@@ -86,6 +96,52 @@ module Fog
86
96
  def reload
87
97
  @connection.reset
88
98
  end
99
+
100
+ # Change the current account while re-using the auth token.
101
+ #
102
+ # This is usefull when you have an admin role and you're able
103
+ # to HEAD other user accounts, set quotas, list files, etc.
104
+ #
105
+ # For example:
106
+ #
107
+ # # List current user account details
108
+ # service = Fog::Storage[:openstack]
109
+ # service.request :method => 'HEAD'
110
+ #
111
+ # Would return something like:
112
+ #
113
+ # Account: AUTH_1234
114
+ # Date: Tue, 05 Mar 2013 16:50:52 GMT
115
+ # X-Account-Bytes-Used: 0 (0.00 Bytes)
116
+ # X-Account-Container-Count: 0
117
+ # X-Account-Object-Count: 0
118
+ #
119
+ # Now let's change the account
120
+ #
121
+ # service.change_account('AUTH_3333')
122
+ # service.request :method => 'HEAD'
123
+ #
124
+ # Would return something like:
125
+ #
126
+ # Account: AUTH_3333
127
+ # Date: Tue, 05 Mar 2013 16:51:53 GMT
128
+ # X-Account-Bytes-Used: 23423433
129
+ # X-Account-Container-Count: 2
130
+ # X-Account-Object-Count: 10
131
+ #
132
+ # If we wan't to go back to our original admin account:
133
+ #
134
+ # service.reset_account_name
135
+ #
136
+ def change_account(account)
137
+ @original_path ||= @path
138
+ version_string = @path.split('/')[1]
139
+ @path = "/#{version_string}/#{account}"
140
+ end
141
+
142
+ def reset_account_name
143
+ @path = @original_path
144
+ end
89
145
 
90
146
  def request(params, parse_json = true, &block)
91
147
  begin
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cifrado
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Rubio
@@ -29,7 +29,7 @@ cert_chain:
29
29
  /Nnaz9wOXu6/VjBcnvFOGY8f32hVq619QiJVpV9zRgYa5M05mWRmwHByrb4yK0Ab
30
30
  3GpyuMMNBMk=
31
31
  -----END CERTIFICATE-----
32
- date: 2013-03-04 00:00:00.000000000 Z
32
+ date: 2013-03-05 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: excon
@@ -197,6 +197,7 @@ files:
197
197
  - lib/cifrado/cli/setup.rb
198
198
  - lib/cifrado/cli/stat.rb
199
199
  - lib/cifrado/cli/upload.rb
200
+ - lib/cifrado/cli/version.rb
200
201
  - lib/cifrado/config.rb
201
202
  - lib/cifrado/core_ext/ruby18_base64.rb
202
203
  - lib/cifrado/crypto_services.rb
metadata.gz.sig CHANGED
Binary file