nephophobia 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,13 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nephophobia (0.0.5)
4
+ nephophobia (0.0.6)
5
5
  hugs (~> 2.5.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- autotest-standalone (4.5.5)
11
10
  fakeweb (1.3.0)
12
11
  hugs (2.5.0)
13
12
  multipart-post (~> 1.0.1)
@@ -26,7 +25,6 @@ PLATFORMS
26
25
  ruby
27
26
 
28
27
  DEPENDENCIES
29
- autotest-standalone
30
28
  fakeweb (~> 1.3.0)
31
29
  minitest (~> 2.0.2)
32
30
  nephophobia!
@@ -5,8 +5,8 @@ module Nephophobia
5
5
  # +host+: A String with the host to connect.
6
6
  # +access_key+: A String containing the AWS Access Key.
7
7
  # +secret_key+: A String containing the AWS Secret Key.
8
- # +project+: A String containing the "Project Name" the
9
- # Acccess Key is intended for.
8
+ # +project+: An optional String containing the "Project Name"
9
+ # the Acccess Key is intended for.
10
10
 
11
11
  def initialize options
12
12
  @port = options[:port] || 8773
@@ -40,7 +40,8 @@ module Nephophobia
40
40
  def all filter = {}
41
41
  response = @client.action "DescribeInstances", filter
42
42
 
43
- Nephophobia.coerce(response.body['DescribeInstancesResponse']['reservationSet']['item']).collect do |data|
43
+ item = response.body['DescribeInstancesResponse']['reservationSet']['item']
44
+ Nephophobia.coerce(item).collect do |data|
44
45
  ComputeData.new data
45
46
  end
46
47
  end
@@ -38,7 +38,8 @@ module Nephophobia
38
38
  def all filter = {}
39
39
  response = @client.action "DescribeImages", filter
40
40
 
41
- Nephophobia.coerce(response.body['DescribeImagesResponse']['imagesSet']['item']).collect do |data|
41
+ item = response.body['DescribeImagesResponse']['imagesSet']['item']
42
+ Nephophobia.coerce(item).collect do |data|
42
43
  ImageData.new data
43
44
  end
44
45
  end
@@ -35,15 +35,21 @@ module Nephophobia
35
35
  end
36
36
 
37
37
  ##
38
- # Returns information about all projects.
38
+ # Returns information about all projects, or all projects the given
39
+ # 'user_name' is in.
40
+ #
41
+ # +user_name+: An optional String representing a nova user_name.
39
42
 
40
- def all
43
+ def all user_name = nil
41
44
  response = @client.action "DescribeProjects", {}
42
45
 
43
- item = response.body['DescribeProjectsResponse']['projectSet']['item']
44
- Nephophobia.coerce(item).collect do |data|
46
+ item = response.body['DescribeProjectsResponse']['projectSet']['item']
47
+ projects = Nephophobia.coerce(item).collect do |data|
45
48
  ProjectData.new data
46
49
  end
50
+
51
+ return projects unless user_name
52
+ projects.map { |project| project if @client.project.member? user_name, project.name }.compact
47
53
  end
48
54
 
49
55
  ##
@@ -14,6 +14,26 @@ module Nephophobia
14
14
  @client = client
15
15
  end
16
16
 
17
+ ##
18
+ # Returns global roles for the given 'user_name', or for the given 'project_name'.
19
+ #
20
+ # +user_name+: A String representing a nova user_name.
21
+ # +project_name+: An Optional String representing a nova project_name name.
22
+
23
+ def all user_name, project_name = nil
24
+ params = {
25
+ "User" => user_name,
26
+ }
27
+ params.merge!("Project" => project_name) if project_name
28
+
29
+ response = @client.action "DescribeUserRoles", params
30
+
31
+ roles = response.body['DescribeUserRolesResponse']['roles']
32
+ roles && Nephophobia.coerce(roles['item']).collect do |data|
33
+ RoleData.new data
34
+ end
35
+ end
36
+
17
37
  ##
18
38
  # Adds the given 'user_name' to the global 'Role::DEFAULT', unless a
19
39
  # 'role_name' is provided.
@@ -21,7 +41,7 @@ module Nephophobia
21
41
  #
22
42
  # +user_name+: A String representing a nova user_name.
23
43
  # +project_name+: An Optional String representing a nova project_name name.
24
- # +project_name+: An Optional String representing a nova role name.
44
+ # +role_name+: An Optional String representing a nova role name.
25
45
 
26
46
  def create user_name, project_name = nil, role_name = nil
27
47
  modify_role user_name, "add", project_name, role_name
@@ -33,32 +53,12 @@ module Nephophobia
33
53
  #
34
54
  # +user_name+: A String representing a nova user_name.
35
55
  # +project_name+: An Optional String representing a nova project_name name.
36
- # +project_name+: An Optional String representing a nova role name.
56
+ # +role_name+: An Optional String representing a nova role name.
37
57
 
38
58
  def destroy user_name, project_name = nil, role_name = nil
39
59
  modify_role user_name, "remove", project_name
40
60
  end
41
61
 
42
- ##
43
- # Returns roles for the given 'user_name' and 'project_name'.
44
- #
45
- # +user_name+: A String representing a nova user_name.
46
- # +project_name+: An Optional String representing a nova project_name name.
47
-
48
- def all user_name, project_name
49
- params = {
50
- "User" => user_name,
51
- "Project" => project_name
52
- }
53
-
54
- response = @client.action "DescribeUserRoles", params
55
-
56
- response.body['DescribeUserRolesResponse']['roles'] &&
57
- Nephophobia.coerce(response.body['DescribeUserRolesResponse']['roles']['item']).collect do |data|
58
- RoleData.new data
59
- end
60
- end
61
-
62
62
  private
63
63
  def modify_role user_name, operation, project_name = nil, role_name = nil
64
64
  params = {
@@ -66,5 +66,23 @@ module Nephophobia
66
66
  UserData.new response.body['DescribeUserResponse']
67
67
  rescue Hugs::Errors::BadRequest
68
68
  end
69
+
70
+ ##
71
+ # Apply a set of global and per-project permissions to the given 'user_name'.
72
+ # Do the following if the 'user_name' is not a member of the 'project_name'.
73
+ # - Add the 'user_name' with the default role (sysadmin) globally.
74
+ # - Add the 'user_name' to the 'project_name', with the default role (sysadmin).
75
+ # - Add the 'user_name' as a member to the 'project_name'
76
+ #
77
+ # +user_name+: A String representing a nova user_name.
78
+ # +project_name+: A String representing a nova project_name name.
79
+
80
+ def register user_name, project_name
81
+ unless @client.project.member? user_name, project_name
82
+ @client.role.create user_name
83
+ @client.role.create user_name, project_name
84
+ @client.project.add_member user_name, project_name
85
+ end
86
+ end
69
87
  end
70
88
  end
@@ -1,3 +1,3 @@
1
1
  module Nephophobia
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/nephophobia.gemspec CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency "hugs", "~> 2.5.0"
23
23
 
24
- s.add_development_dependency "autotest-standalone"
25
24
  s.add_development_dependency "fakeweb", "~> 1.3.0"
26
25
  s.add_development_dependency "minitest", "~> 2.0.2"
27
26
  s.add_development_dependency "nokogiri", "~> 1.4.4"
@@ -26,3 +26,113 @@
26
26
  - keep-alive
27
27
  body: <?xml version="1.0" ?><DescribeProjectsResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>14AT8GET5S8HT3MARR1N</requestId><projectSet><item><projectname>production</projectname><projectManagerId>kbringard</projectManagerId><description>production</description></item><item><projectname>non-production</projectname><projectManagerId>root</projectManagerId><description>non-production</description></item><item><projectname>jtran</projectname><projectManagerId>jtran</projectManagerId><description>jtran</description></item><item><projectname>foobar_project</projectname><projectManagerId>foobar_user</projectManagerId><description>foobar_project</description></item><item><projectname>vcr_project</projectname><projectManagerId>vcr</projectManagerId><description>vcr_project</description></item></projectSet></DescribeProjectsResponse>
28
28
  http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=production&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=to4Ia9Otnptorh4mIc11yfQgkbSZOiUdvt2%2FcqD%2Foa8%3D
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/xml
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/xml
48
+ content-length:
49
+ - "568"
50
+ date:
51
+ - Tue, 15 Mar 2011 19:38:27 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>OSFBXUB0L1OZYX-D7ALD</requestId><members><item><member>tr0001</member></item><item><member>jtran</member></item><item><member>jdewey</member></item><item><member>jkleinpeter</member></item><item><member>kbringard</member></item><item><member>root</member></item><item><member>jt708u</member></item><item><member>xx1234</member></item><item><member>jk520u</member></item><item><member>foobar_user</member></item></members></DescribeProjectMembersResponse>
55
+ http_version: "1.1"
56
+ - !ruby/struct:VCR::HTTPInteraction
57
+ request: !ruby/struct:VCR::Request
58
+ method: :get
59
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=non-production&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=6F%2Fg04mZ17i5VyPzeZSDleMiAKbRdqhKSXDzGpE%2BdjU%3D
60
+ body:
61
+ headers:
62
+ accept:
63
+ - application/xml
64
+ connection:
65
+ - keep-alive
66
+ keep-alive:
67
+ - 30
68
+ response: !ruby/struct:VCR::Response
69
+ status: !ruby/struct:VCR::ResponseStatus
70
+ code: 200
71
+ message: OK
72
+ headers:
73
+ content-type:
74
+ - text/xml
75
+ content-length:
76
+ - "752"
77
+ date:
78
+ - Tue, 15 Mar 2011 19:38:27 GMT
79
+ connection:
80
+ - keep-alive
81
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>9XIELH48TMI7AX5QQPML</requestId><members><item><member>xx1234</member></item><item><member>root</member></item><item><member>jkleinpeter</member></item><item><member>jt708u</member></item><item><member>tr0001</member></item><item><member>jdewey</member></item><item><member>ccrissman</member></item><item><member>kbringard</member></item><item><member>cnoshpitz</member></item><item><member>dfong</member></item><item><member>jheiss</member></item><item><member>gnolan</member></item><item><member>msaltman</member></item><item><member>amikula</member></item><item><member>jk520u</member></item></members></DescribeProjectMembersResponse>
82
+ http_version: "1.1"
83
+ - !ruby/struct:VCR::HTTPInteraction
84
+ request: !ruby/struct:VCR::Request
85
+ method: :get
86
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=jtran&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=aFpEU0vSiw3TVrDh2U55abIUl0PjVhr8J1b8AzViiqE%3D
87
+ body:
88
+ headers:
89
+ accept:
90
+ - application/xml
91
+ connection:
92
+ - keep-alive
93
+ keep-alive:
94
+ - 30
95
+ response: !ruby/struct:VCR::Response
96
+ status: !ruby/struct:VCR::ResponseStatus
97
+ code: 200
98
+ message: OK
99
+ headers:
100
+ content-type:
101
+ - text/xml
102
+ content-length:
103
+ - "233"
104
+ date:
105
+ - Tue, 15 Mar 2011 19:38:27 GMT
106
+ connection:
107
+ - keep-alive
108
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>QEBDLN4L5ADKEEK7S6QK</requestId><members><item><member>jtran</member></item></members></DescribeProjectMembersResponse>
109
+ http_version: "1.1"
110
+ - !ruby/struct:VCR::HTTPInteraction
111
+ request: !ruby/struct:VCR::Request
112
+ method: :get
113
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=foobar_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=KPVzBFN8AFrlySQ%2FaVy3xnVy2tDKZIWQcMcvcZ01W%2BE%3D
114
+ body:
115
+ headers:
116
+ accept:
117
+ - application/xml
118
+ connection:
119
+ - keep-alive
120
+ keep-alive:
121
+ - 30
122
+ response: !ruby/struct:VCR::Response
123
+ status: !ruby/struct:VCR::ResponseStatus
124
+ code: 400
125
+ message: Bad Request
126
+ headers:
127
+ content-type:
128
+ - text/xml
129
+ content-length:
130
+ - "191"
131
+ date:
132
+ - Tue, 15 Mar 2011 19:38:27 GMT
133
+ connection:
134
+ - keep-alive
135
+ body: |-
136
+ <?xml version="1.0"?>
137
+ <Response><Errors><Error><Code>NotFound</Code><Message>No project with id foobar_project</Message></Error></Errors><RequestID>XOSK7KB49YY73XMXJOAQ</RequestID></Response>
138
+ http_version: "1.1"
@@ -26,3 +26,30 @@
26
26
  - keep-alive
27
27
  body: <?xml version="1.0" ?><DescribeProjectsResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>Z70PV9C4OC3EO6HWL86O</requestId><projectSet><item><projectname>production</projectname><projectManagerId>root</projectManagerId><description>production</description></item></projectSet></DescribeProjectsResponse>
28
28
  http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=production&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=to4Ia9Otnptorh4mIc11yfQgkbSZOiUdvt2%2FcqD%2Foa8%3D
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/xml
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/xml
48
+ content-length:
49
+ - "568"
50
+ date:
51
+ - Tue, 15 Mar 2011 19:38:27 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>8VW-W23I92NC2MKWUYFQ</requestId><members><item><member>tr0001</member></item><item><member>jtran</member></item><item><member>jdewey</member></item><item><member>jkleinpeter</member></item><item><member>kbringard</member></item><item><member>root</member></item><item><member>jt708u</member></item><item><member>xx1234</member></item><item><member>jk520u</member></item><item><member>foobar_user</member></item></members></DescribeProjectMembersResponse>
55
+ http_version: "1.1"
@@ -0,0 +1,136 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjects&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=9X90VDxMZC4r85r5C3CuAAqIFkDNdwp7xW%2BMKybpbVo%3D
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ connection:
11
+ - keep-alive
12
+ keep-alive:
13
+ - 30
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ content-type:
20
+ - text/xml
21
+ content-length:
22
+ - "710"
23
+ date:
24
+ - Tue, 15 Mar 2011 19:38:49 GMT
25
+ connection:
26
+ - keep-alive
27
+ body: <?xml version="1.0" ?><DescribeProjectsResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>QBL1KZGORE1WSHPKTZQX</requestId><projectSet><item><projectname>production</projectname><projectManagerId>kbringard</projectManagerId><description>production</description></item><item><projectname>non-production</projectname><projectManagerId>root</projectManagerId><description>non-production</description></item><item><projectname>jtran</projectname><projectManagerId>jtran</projectManagerId><description>jtran</description></item><item><projectname>vcr_project</projectname><projectManagerId>root</projectManagerId><description>vcr_project</description></item></projectSet></DescribeProjectsResponse>
28
+ http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=production&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=to4Ia9Otnptorh4mIc11yfQgkbSZOiUdvt2%2FcqD%2Foa8%3D
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/xml
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/xml
48
+ content-length:
49
+ - "568"
50
+ date:
51
+ - Tue, 15 Mar 2011 19:38:49 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>RE0W1YXC77AJYJP9TFHR</requestId><members><item><member>tr0001</member></item><item><member>jtran</member></item><item><member>jdewey</member></item><item><member>jkleinpeter</member></item><item><member>kbringard</member></item><item><member>root</member></item><item><member>jt708u</member></item><item><member>xx1234</member></item><item><member>jk520u</member></item><item><member>foobar_user</member></item></members></DescribeProjectMembersResponse>
55
+ http_version: "1.1"
56
+ - !ruby/struct:VCR::HTTPInteraction
57
+ request: !ruby/struct:VCR::Request
58
+ method: :get
59
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=non-production&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=6F%2Fg04mZ17i5VyPzeZSDleMiAKbRdqhKSXDzGpE%2BdjU%3D
60
+ body:
61
+ headers:
62
+ accept:
63
+ - application/xml
64
+ connection:
65
+ - keep-alive
66
+ keep-alive:
67
+ - 30
68
+ response: !ruby/struct:VCR::Response
69
+ status: !ruby/struct:VCR::ResponseStatus
70
+ code: 200
71
+ message: OK
72
+ headers:
73
+ content-type:
74
+ - text/xml
75
+ content-length:
76
+ - "752"
77
+ date:
78
+ - Tue, 15 Mar 2011 19:38:49 GMT
79
+ connection:
80
+ - keep-alive
81
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>VAKRKANAHASBUV24FKVX</requestId><members><item><member>xx1234</member></item><item><member>root</member></item><item><member>jkleinpeter</member></item><item><member>jt708u</member></item><item><member>tr0001</member></item><item><member>jdewey</member></item><item><member>ccrissman</member></item><item><member>kbringard</member></item><item><member>cnoshpitz</member></item><item><member>dfong</member></item><item><member>jheiss</member></item><item><member>gnolan</member></item><item><member>msaltman</member></item><item><member>amikula</member></item><item><member>jk520u</member></item></members></DescribeProjectMembersResponse>
82
+ http_version: "1.1"
83
+ - !ruby/struct:VCR::HTTPInteraction
84
+ request: !ruby/struct:VCR::Request
85
+ method: :get
86
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=jtran&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=aFpEU0vSiw3TVrDh2U55abIUl0PjVhr8J1b8AzViiqE%3D
87
+ body:
88
+ headers:
89
+ accept:
90
+ - application/xml
91
+ connection:
92
+ - keep-alive
93
+ keep-alive:
94
+ - 30
95
+ response: !ruby/struct:VCR::Response
96
+ status: !ruby/struct:VCR::ResponseStatus
97
+ code: 200
98
+ message: OK
99
+ headers:
100
+ content-type:
101
+ - text/xml
102
+ content-length:
103
+ - "233"
104
+ date:
105
+ - Tue, 15 Mar 2011 19:38:49 GMT
106
+ connection:
107
+ - keep-alive
108
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>YTZTGPGKYVB1B5ASTQCR</requestId><members><item><member>jtran</member></item></members></DescribeProjectMembersResponse>
109
+ http_version: "1.1"
110
+ - !ruby/struct:VCR::HTTPInteraction
111
+ request: !ruby/struct:VCR::Request
112
+ method: :get
113
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=gHOqFyMbBRExsof4ZYyb1qT%2BE%2BV5v8vThS5g%2FpsTWTA%3D
114
+ body:
115
+ headers:
116
+ accept:
117
+ - application/xml
118
+ connection:
119
+ - keep-alive
120
+ keep-alive:
121
+ - 30
122
+ response: !ruby/struct:VCR::Response
123
+ status: !ruby/struct:VCR::ResponseStatus
124
+ code: 200
125
+ message: OK
126
+ headers:
127
+ content-type:
128
+ - text/xml
129
+ content-length:
130
+ - "265"
131
+ date:
132
+ - Tue, 15 Mar 2011 19:38:49 GMT
133
+ connection:
134
+ - keep-alive
135
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>IOA39NC3CLKQZNOSYOTP</requestId><members><item><member>vcr</member></item><item><member>root</member></item></members></DescribeProjectMembersResponse>
136
+ http_version: "1.1"
@@ -2,7 +2,7 @@
2
2
  - !ruby/struct:VCR::HTTPInteraction
3
3
  request: !ruby/struct:VCR::Request
4
4
  method: :get
5
- uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&Project=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=%2BcyU1%2FtdIwdsSv93sPpEuIiqp98z9JrrgBUXFRG1%2BxU%3D
5
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=4cL%2F8Xee6tVO2FdaLCDFqwMjUtcI7ZEGQ3jrObIDnME%3D
6
6
  body:
7
7
  headers:
8
8
  accept:
@@ -21,8 +21,8 @@
21
21
  content-length:
22
22
  - "252"
23
23
  date:
24
- - Tue, 15 Mar 2011 05:13:37 GMT
24
+ - Tue, 15 Mar 2011 18:42:15 GMT
25
25
  connection:
26
26
  - keep-alive
27
- body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>GTSH6DJB-6M7UXU3PUAV</requestId><roles><item><role>netadmin</role></item><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
27
+ body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>7A0XC5GFNKYV9KG6TLFN</requestId><roles><item><role>netadmin</role></item><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
28
28
  http_version: "1.1"
@@ -2,7 +2,7 @@
2
2
  - !ruby/struct:VCR::HTTPInteraction
3
3
  request: !ruby/struct:VCR::Request
4
4
  method: :get
5
- uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&Project=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=%2BcyU1%2FtdIwdsSv93sPpEuIiqp98z9JrrgBUXFRG1%2BxU%3D
5
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=4cL%2F8Xee6tVO2FdaLCDFqwMjUtcI7ZEGQ3jrObIDnME%3D
6
6
  body:
7
7
  headers:
8
8
  accept:
@@ -21,8 +21,8 @@
21
21
  content-length:
22
22
  - "177"
23
23
  date:
24
- - Tue, 15 Mar 2011 05:20:34 GMT
24
+ - Tue, 15 Mar 2011 18:38:50 GMT
25
25
  connection:
26
26
  - keep-alive
27
- body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>TEE0U3M0GKQS-2RUT0KF</requestId><roles/></DescribeUserRolesResponse>
27
+ body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>ANJC26US8VD5-U8Q6FBP</requestId><roles/></DescribeUserRolesResponse>
28
28
  http_version: "1.1"
@@ -0,0 +1,28 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&Project=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=%2BcyU1%2FtdIwdsSv93sPpEuIiqp98z9JrrgBUXFRG1%2BxU%3D
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ connection:
11
+ - keep-alive
12
+ keep-alive:
13
+ - 30
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ content-type:
20
+ - text/xml
21
+ content-length:
22
+ - "218"
23
+ date:
24
+ - Tue, 15 Mar 2011 18:41:47 GMT
25
+ connection:
26
+ - keep-alive
27
+ body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>MHZGC1VPI8NCZ3M9GEER</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
28
+ http_version: "1.1"
@@ -2,7 +2,7 @@
2
2
  - !ruby/struct:VCR::HTTPInteraction
3
3
  request: !ruby/struct:VCR::Request
4
4
  method: :get
5
- uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&Project=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=%2BcyU1%2FtdIwdsSv93sPpEuIiqp98z9JrrgBUXFRG1%2BxU%3D
5
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=4cL%2F8Xee6tVO2FdaLCDFqwMjUtcI7ZEGQ3jrObIDnME%3D
6
6
  body:
7
7
  headers:
8
8
  accept:
@@ -19,10 +19,10 @@
19
19
  content-type:
20
20
  - text/xml
21
21
  content-length:
22
- - "252"
22
+ - "218"
23
23
  date:
24
- - Mon, 07 Mar 2011 23:23:41 GMT
24
+ - Tue, 15 Mar 2011 18:36:29 GMT
25
25
  connection:
26
26
  - keep-alive
27
- body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>5P5XXDX7JWE3X1VH7XV8</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
27
+ body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>0SPSJGHYS4JUGL0Z446G</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
28
28
  http_version: "1.1"
@@ -0,0 +1,109 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=gHOqFyMbBRExsof4ZYyb1qT%2BE%2BV5v8vThS5g%2FpsTWTA%3D
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ connection:
11
+ - keep-alive
12
+ keep-alive:
13
+ - 30
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ content-type:
20
+ - text/xml
21
+ content-length:
22
+ - "246"
23
+ date:
24
+ - Tue, 15 Mar 2011 15:43:23 GMT
25
+ connection:
26
+ - keep-alive
27
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>PF9RQ7CQ5-9XNELUEORV</requestId><members><item><member>vcr_secondary_user</member></item></members></DescribeProjectMembersResponse>
28
+ http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=ModifyUserRole&Operation=add&Role=sysadmin&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=1pr9CCVAt6dzAZAfOJnJqeNvOfzpyRZ8bbicbHva%2B%2BQ%3D
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/xml
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/xml
48
+ content-length:
49
+ - "184"
50
+ date:
51
+ - Tue, 15 Mar 2011 15:43:23 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: <?xml version="1.0" ?><ModifyUserRoleResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>RT0LZ6L8IGGE1Y6MBK3E</requestId><return>true</return></ModifyUserRoleResponse>
55
+ http_version: "1.1"
56
+ - !ruby/struct:VCR::HTTPInteraction
57
+ request: !ruby/struct:VCR::Request
58
+ method: :get
59
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=ModifyUserRole&Operation=add&Project=vcr_project&Role=sysadmin&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=GTVgObXtEYZbqocvTtCTVfe0V6MH6cqXMGxLcp1CypU%3D
60
+ body:
61
+ headers:
62
+ accept:
63
+ - application/xml
64
+ connection:
65
+ - keep-alive
66
+ keep-alive:
67
+ - 30
68
+ response: !ruby/struct:VCR::Response
69
+ status: !ruby/struct:VCR::ResponseStatus
70
+ code: 200
71
+ message: OK
72
+ headers:
73
+ content-type:
74
+ - text/xml
75
+ content-length:
76
+ - "184"
77
+ date:
78
+ - Tue, 15 Mar 2011 15:43:24 GMT
79
+ connection:
80
+ - keep-alive
81
+ body: <?xml version="1.0" ?><ModifyUserRoleResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>JU8BSHT2-9EZE62GTX0E</requestId><return>true</return></ModifyUserRoleResponse>
82
+ http_version: "1.1"
83
+ - !ruby/struct:VCR::HTTPInteraction
84
+ request: !ruby/struct:VCR::Request
85
+ method: :get
86
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=ModifyProjectMember&Operation=add&Project=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=kUeSgymY2fgmy5Hac0u67%2FwqzFB7TZQAl%2BcIrYIZT3I%3D
87
+ body:
88
+ headers:
89
+ accept:
90
+ - application/xml
91
+ connection:
92
+ - keep-alive
93
+ keep-alive:
94
+ - 30
95
+ response: !ruby/struct:VCR::Response
96
+ status: !ruby/struct:VCR::ResponseStatus
97
+ code: 200
98
+ message: OK
99
+ headers:
100
+ content-type:
101
+ - text/xml
102
+ content-length:
103
+ - "194"
104
+ date:
105
+ - Tue, 15 Mar 2011 15:43:24 GMT
106
+ connection:
107
+ - keep-alive
108
+ body: <?xml version="1.0" ?><ModifyProjectMemberResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>OQS0QUX81FJ-YTVEXLGF</requestId><return>true</return></ModifyProjectMemberResponse>
109
+ http_version: "1.1"
@@ -0,0 +1,82 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=4cL%2F8Xee6tVO2FdaLCDFqwMjUtcI7ZEGQ3jrObIDnME%3D
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ connection:
11
+ - keep-alive
12
+ keep-alive:
13
+ - 30
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ content-type:
20
+ - text/xml
21
+ content-length:
22
+ - "218"
23
+ date:
24
+ - Tue, 15 Mar 2011 18:54:31 GMT
25
+ connection:
26
+ - keep-alive
27
+ body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>20VUX7J0JXV5YAVXGB1K</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
28
+ http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeUserRoles&Project=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr&Version=2010-11-15&Signature=%2BcyU1%2FtdIwdsSv93sPpEuIiqp98z9JrrgBUXFRG1%2BxU%3D
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/xml
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/xml
48
+ content-length:
49
+ - "218"
50
+ date:
51
+ - Tue, 15 Mar 2011 18:54:31 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>VQNU38MYFNW4Q4NM0JCT</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
55
+ http_version: "1.1"
56
+ - !ruby/struct:VCR::HTTPInteraction
57
+ request: !ruby/struct:VCR::Request
58
+ method: :get
59
+ uri: http://10.1.170.32:8773/services/Admin/?AWSAccessKeyId=1d7a687b-0065-44d6-9611-5bf6c6c72424%3Aproduction&Action=DescribeProjectMembers&Name=vcr_project&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=gHOqFyMbBRExsof4ZYyb1qT%2BE%2BV5v8vThS5g%2FpsTWTA%3D
60
+ body:
61
+ headers:
62
+ accept:
63
+ - application/xml
64
+ connection:
65
+ - keep-alive
66
+ keep-alive:
67
+ - 30
68
+ response: !ruby/struct:VCR::Response
69
+ status: !ruby/struct:VCR::ResponseStatus
70
+ code: 200
71
+ message: OK
72
+ headers:
73
+ content-type:
74
+ - text/xml
75
+ content-length:
76
+ - "279"
77
+ date:
78
+ - Tue, 15 Mar 2011 18:54:31 GMT
79
+ connection:
80
+ - keep-alive
81
+ body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>QDZIK8UQTQJPPZX8J6Q7</requestId><members><item><member>vcr</member></item><item><member>vcr_secondary_user</member></item></members></DescribeProjectMembersResponse>
82
+ http_version: "1.1"
@@ -38,6 +38,16 @@ describe Nephophobia::Project do
38
38
  end
39
39
  end
40
40
 
41
+ describe "#all with a user_name" do
42
+ it "returns all projects for the given 'user_name'" do
43
+ VCR.use_cassette "project_all_with_with_user_name" do
44
+ response = @project.all @user_name
45
+
46
+ response.size.must_equal 1
47
+ end
48
+ end
49
+ end
50
+
41
51
  describe "#create" do
42
52
  it "creates the given 'user_name' in the specified 'project_name'" do
43
53
  VCR.use_cassette "project_create" do
@@ -7,6 +7,42 @@ describe Nephophobia::Role do
7
7
  @project_name = "vcr_project"
8
8
  end
9
9
 
10
+ describe "#all" do
11
+ it "returns all roles for the given 'user_name'" do
12
+ VCR.use_cassette "role_all" do
13
+ response = @role.all @user_name
14
+
15
+ response.size.must_equal 2
16
+ end
17
+ end
18
+
19
+ it "has a 'TypeError: can't convert String into Integer' error" do
20
+ VCR.use_cassette "role_all_with_string_into_int_error" do
21
+ response = @role.all @user_name
22
+
23
+ response.size.must_equal 1
24
+ end
25
+ end
26
+
27
+ it "has a 'NoMethodError: undefined method `[]' for nil:NilClass' error" do
28
+ VCR.use_cassette "role_all_with_no_roles" do
29
+ response = @role.all @user_name
30
+
31
+ response.must_be_nil
32
+ end
33
+ end
34
+ end
35
+
36
+ describe "#all with a project_name" do
37
+ it "returns all roles for the given 'user_name' and 'project_name'" do
38
+ VCR.use_cassette "role_all_with_project_name" do
39
+ response = @role.all @user_name, @project_name
40
+
41
+ response.size.must_equal 1
42
+ end
43
+ end
44
+ end
45
+
10
46
  describe "#create" do
11
47
  before { @role_name = "netadmin" }
12
48
 
@@ -62,30 +98,4 @@ describe Nephophobia::Role do
62
98
  end
63
99
  end
64
100
  end
65
-
66
- describe "#all" do
67
- it "returns all roles for the given 'user_name' and 'project_name'" do
68
- VCR.use_cassette "role_all" do
69
- response = @role.all @user_name, @project_name
70
-
71
- response.size.must_equal 2
72
- end
73
- end
74
-
75
- it "has a 'TypeError: can't convert String into Integer' error" do
76
- VCR.use_cassette "role_all_with_string_into_int_error" do
77
- response = @role.all @user_name, @project_name
78
-
79
- response.size.must_equal 1
80
- end
81
- end
82
-
83
- it "has a 'NoMethodError: undefined method `[]' for nil:NilClass' error" do
84
- VCR.use_cassette "role_all_with_no_roles" do
85
- response = @role.all @user_name, @project_name
86
-
87
- response.must_be_nil
88
- end
89
- end
90
- end
91
101
  end
@@ -67,4 +67,24 @@ describe Nephophobia::User do
67
67
  @response.must_be_nil
68
68
  end
69
69
  end
70
+
71
+ describe "#register" do
72
+ before do
73
+ @project_name = "vcr_project"
74
+ @role = ::Client.with(:admin).role
75
+ @project = ::Client.with(:admin).project
76
+ end
77
+
78
+ it "applies a set of global and per-project permissions to the given 'user_name'" do
79
+ VCR.use_cassette "user_register" do
80
+ @response = @user.register @user_name, @project_name
81
+ end
82
+
83
+ VCR.use_cassette "user_register_assert" do
84
+ @role.all(@user_name).first.name.must_equal "sysadmin"
85
+ @role.all(@user_name, @project_name).first.name.must_equal "sysadmin"
86
+ @project.member?(@user_name, @project_name).must_equal true
87
+ end
88
+ end
89
+ end
70
90
  end
data/test/test_helper.rb CHANGED
@@ -18,7 +18,7 @@ end
18
18
  VCR.config do |c|
19
19
  c.stub_with :fakeweb
20
20
  c.cassette_library_dir = "test/cassettes"
21
- c.default_cassette_options = { :record => :new_episodes }
21
+ c.default_cassette_options = { :record => :none }
22
22
  end
23
23
 
24
24
  class Client
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nephophobia
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - John Dewey
@@ -25,72 +25,61 @@ dependencies:
25
25
  version: 2.5.0
26
26
  type: :runtime
27
27
  version_requirements: *id001
28
- - !ruby/object:Gem::Dependency
29
- name: autotest-standalone
30
- prerelease: false
31
- requirement: &id002 !ruby/object:Gem::Requirement
32
- none: false
33
- requirements:
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: "0"
37
- type: :development
38
- version_requirements: *id002
39
28
  - !ruby/object:Gem::Dependency
40
29
  name: fakeweb
41
30
  prerelease: false
42
- requirement: &id003 !ruby/object:Gem::Requirement
31
+ requirement: &id002 !ruby/object:Gem::Requirement
43
32
  none: false
44
33
  requirements:
45
34
  - - ~>
46
35
  - !ruby/object:Gem::Version
47
36
  version: 1.3.0
48
37
  type: :development
49
- version_requirements: *id003
38
+ version_requirements: *id002
50
39
  - !ruby/object:Gem::Dependency
51
40
  name: minitest
52
41
  prerelease: false
53
- requirement: &id004 !ruby/object:Gem::Requirement
42
+ requirement: &id003 !ruby/object:Gem::Requirement
54
43
  none: false
55
44
  requirements:
56
45
  - - ~>
57
46
  - !ruby/object:Gem::Version
58
47
  version: 2.0.2
59
48
  type: :development
60
- version_requirements: *id004
49
+ version_requirements: *id003
61
50
  - !ruby/object:Gem::Dependency
62
51
  name: nokogiri
63
52
  prerelease: false
64
- requirement: &id005 !ruby/object:Gem::Requirement
53
+ requirement: &id004 !ruby/object:Gem::Requirement
65
54
  none: false
66
55
  requirements:
67
56
  - - ~>
68
57
  - !ruby/object:Gem::Version
69
58
  version: 1.4.4
70
59
  type: :development
71
- version_requirements: *id005
60
+ version_requirements: *id004
72
61
  - !ruby/object:Gem::Dependency
73
62
  name: rake
74
63
  prerelease: false
75
- requirement: &id006 !ruby/object:Gem::Requirement
64
+ requirement: &id005 !ruby/object:Gem::Requirement
76
65
  none: false
77
66
  requirements:
78
67
  - - ~>
79
68
  - !ruby/object:Gem::Version
80
69
  version: 0.8.7
81
70
  type: :development
82
- version_requirements: *id006
71
+ version_requirements: *id005
83
72
  - !ruby/object:Gem::Dependency
84
73
  name: vcr
85
74
  prerelease: false
86
- requirement: &id007 !ruby/object:Gem::Requirement
75
+ requirement: &id006 !ruby/object:Gem::Requirement
87
76
  none: false
88
77
  requirements:
89
78
  - - "="
90
79
  - !ruby/object:Gem::Version
91
80
  version: 1.5.0
92
81
  type: :development
93
- version_requirements: *id007
82
+ version_requirements: *id006
94
83
  description: This gem is a simple binding to the EC2 API. It has specific extensions to allow extra functionality provided by OpenStack.
95
84
  email:
96
85
  - jdewey@attinteractive.com
@@ -102,7 +91,6 @@ extensions: []
102
91
  extra_rdoc_files: []
103
92
 
104
93
  files:
105
- - .autotest
106
94
  - .gitignore
107
95
  - .rvmrc
108
96
  - Gemfile
@@ -135,6 +123,7 @@ files:
135
123
  - test/cassettes/project_add_member.yml
136
124
  - test/cassettes/project_all.yml
137
125
  - test/cassettes/project_all_with_string_into_int_error.yml
126
+ - test/cassettes/project_all_with_with_user_name.yml
138
127
  - test/cassettes/project_create.yml
139
128
  - test/cassettes/project_destroy.yml
140
129
  - test/cassettes/project_find.yml
@@ -146,6 +135,7 @@ files:
146
135
  - test/cassettes/project_remove_member.yml
147
136
  - test/cassettes/role_all.yml
148
137
  - test/cassettes/role_all_with_no_roles.yml
138
+ - test/cassettes/role_all_with_project_name.yml
149
139
  - test/cassettes/role_all_with_string_into_int_error.yml
150
140
  - test/cassettes/role_create.yml
151
141
  - test/cassettes/role_create_with_project_name.yml
@@ -158,6 +148,8 @@ files:
158
148
  - test/cassettes/user_destroy.yml
159
149
  - test/cassettes/user_find.yml
160
150
  - test/cassettes/user_find_with_invalid_user_name.yml
151
+ - test/cassettes/user_register.yml
152
+ - test/cassettes/user_register_assert.yml
161
153
  - test/lib/aws_test.rb
162
154
  - test/lib/hashify_test.rb
163
155
  - test/lib/nephophobia/compute_test.rb
@@ -211,6 +203,7 @@ test_files:
211
203
  - test/cassettes/project_add_member.yml
212
204
  - test/cassettes/project_all.yml
213
205
  - test/cassettes/project_all_with_string_into_int_error.yml
206
+ - test/cassettes/project_all_with_with_user_name.yml
214
207
  - test/cassettes/project_create.yml
215
208
  - test/cassettes/project_destroy.yml
216
209
  - test/cassettes/project_find.yml
@@ -222,6 +215,7 @@ test_files:
222
215
  - test/cassettes/project_remove_member.yml
223
216
  - test/cassettes/role_all.yml
224
217
  - test/cassettes/role_all_with_no_roles.yml
218
+ - test/cassettes/role_all_with_project_name.yml
225
219
  - test/cassettes/role_all_with_string_into_int_error.yml
226
220
  - test/cassettes/role_create.yml
227
221
  - test/cassettes/role_create_with_project_name.yml
@@ -234,6 +228,8 @@ test_files:
234
228
  - test/cassettes/user_destroy.yml
235
229
  - test/cassettes/user_find.yml
236
230
  - test/cassettes/user_find_with_invalid_user_name.yml
231
+ - test/cassettes/user_register.yml
232
+ - test/cassettes/user_register_assert.yml
237
233
  - test/lib/aws_test.rb
238
234
  - test/lib/hashify_test.rb
239
235
  - test/lib/nephophobia/compute_test.rb
data/.autotest DELETED
@@ -1,29 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- require 'autotest/restart'
4
-
5
- Autotest.add_hook :initialize do |at|
6
- at.testlib = 'minitest/spec'
7
-
8
- %w{.git .svn .hg .swp .DS_Store ._* tmp}.each do |exception|
9
- at.add_exception(exception)
10
- end
11
-
12
- at.clear_mappings
13
- tests = %r%^test/lib/.*_test\.rb$%
14
-
15
- at.add_mapping(%r%^lib/(.*)\.rb$%) do |_, m|
16
- ["test/lib/#{m[1]}_test.rb"]
17
- end
18
-
19
- at.add_mapping(tests) do |filename, _|
20
- filename
21
- end
22
-
23
- at.add_mapping(%r%^test/.*\.rb$%) do
24
- at.files_matching tests
25
- end
26
- end
27
-
28
- # require 'autotest/rcov'
29
- # Autotest::RCov.command = 'rcov_info'