crowd-client 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/crowd-client.gemspec +3 -1
  2. data/lib/crowd-client.rb +2 -2
  3. data/lib/crowd-client/exceptions.rb +2 -1
  4. data/lib/crowd-client/group.rb +42 -0
  5. data/lib/crowd-client/user.rb +121 -0
  6. data/lib/crowd-client/version.rb +1 -1
  7. data/spec/cassettes/Crowd_Client/_in_group_/should_confirm_users_are_in_groups.yml +69 -0
  8. data/spec/cassettes/Crowd_Client/_login/should_authenticate_and_return_a_session_token.yml +42 -0
  9. data/spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_AuthenticationFailed_if_authentication_fails.yml +40 -0
  10. data/spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_InactiveAccount_if_an_account_is_inactive.yml +40 -0
  11. data/spec/cassettes/Crowd_Client/_logout/should_logout_the_current_session.yml +143 -0
  12. data/spec/cassettes/Crowd_Client/_user_groups_username_/should_return_the_groups_of_the_user.yml +36 -0
  13. data/spec/cassettes/Crowd_Client/_user_token_/should_return_the_expanded_user.yml +75 -0
  14. data/spec/cassettes/Crowd_Client/_valid_session_/should_validate_the_current_session.yml +79 -0
  15. data/spec/cassettes/Crowd_Client_Group/_add_user/missing_group/should_raise_Exception_NotFound_for_missing_group.yml +104 -0
  16. data/spec/cassettes/Crowd_Client_Group/_add_user/should_add_the_user.yml +139 -0
  17. data/spec/cassettes/Crowd_Client_Group/_add_user/should_raise_Exception_NotFound_for_missing_user.yml +106 -0
  18. data/spec/cassettes/Crowd_Client_Group/_remove_user/should_remove_the_user.yml +168 -0
  19. data/spec/cassettes/Crowd_Client_Group/_users/should_return_all_of_the_users_in_the_group.yml +36 -0
  20. data/spec/cassettes/Crowd_Client_User/Creating_a_user/should_create_a_user_with_attributes.yml +102 -0
  21. data/spec/cassettes/Crowd_Client_User/Get_groups_for_user/should_be_in_the_group.yml +36 -0
  22. data/spec/cassettes/Crowd_Client_User/Update_user/should_update_user_properties.yml +133 -0
  23. data/spec/cassettes/Crowd_Client_User/_destroy/should_delete_the_user.yml +102 -0
  24. data/spec/cassettes/Crowd_Client_User/authenticate/should_return_false_if_the_password_is_invalid.yml +40 -0
  25. data/spec/cassettes/Crowd_Client_User/authenticate/should_return_true_if_the_password_is_valid.yml +38 -0
  26. data/spec/cassettes/Crowd_Client_User/change_password/should_allow_the_user_to_set_a_new_password.yml +135 -0
  27. data/spec/cassettes/Crowd_Client_User/display_name/.yml +36 -0
  28. data/spec/cassettes/Crowd_Client_User/email/.yml +36 -0
  29. data/spec/crowd-client_group_spec.rb +50 -0
  30. data/spec/crowd-client_spec.rb +0 -3
  31. data/spec/crowd-client_user_spec.rb +75 -0
  32. data/spec/spec_helper.rb +16 -2
  33. metadata +89 -19
  34. data/spec/cassettes/Crowd_Client.yml +0 -358
@@ -0,0 +1,75 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/crowd-client/user')
3
+
4
+ describe Crowd::Client::User do
5
+
6
+ subject { Crowd::Client::User.new('user@example.com') }
7
+
8
+ its(:username) { should == 'user@example.com' }
9
+ its(:display_name) { should == 'Example User' }
10
+ its(:email) { should == 'user@example.com' }
11
+
12
+ describe "Creating a user" do
13
+ it "should create a user with attributes" do
14
+ user = Crowd::Client::User.new('new_user@example.com', {:password => 'test', :first_name => 'New', :last_name => 'User', :email => 'new_user@example.com'})
15
+ user.save
16
+ user.reload!
17
+ user.destroy
18
+ end
19
+ end
20
+
21
+ describe "Get groups for user" do
22
+ it "should be in the group" do
23
+ groups = subject.groups
24
+ groups.size.should == 2
25
+ groups.first.groupname.should == 'MyGroup'
26
+ end
27
+ end
28
+
29
+ describe "Update user" do
30
+ before { @user = Crowd::Client::User.create :username => 'change_user@example.com', :password => 'test', :first_name => 'Change', :last_name => 'User', :email => 'change_user@example.com' }
31
+ after { @user.destroy }
32
+ subject { @user }
33
+
34
+ it "should update user properties" do
35
+ subject.update_attibutes(:first_name => 'New First', :last_name => 'And Last Name')
36
+ subject.reload!
37
+ subject.first_name.should == 'New First'
38
+ subject.last_name.should == 'And Last Name'
39
+ end
40
+ end
41
+
42
+
43
+ describe "authenticate" do
44
+ it "should return true if the password is valid" do
45
+ subject.authenticate?('password').should be_true
46
+ end
47
+
48
+ it "should return false if the password is invalid" do
49
+ subject.authenticate?('invalid').should be_false
50
+ end
51
+ end
52
+
53
+
54
+ describe "change password" do
55
+ before { @user = Crowd::Client::User.create :username => 'change_pass@example.com', :password => 'test', :first_name => 'Change', :last_name => 'Me', :email => 'change_pass@example.com' }
56
+ after { @user.destroy }
57
+ subject { @user }
58
+ it "should allow the user to set a new password" do
59
+ subject.change_password 'new_password'
60
+ subject.authenticate?('new_password').should be_true
61
+ end
62
+ end
63
+
64
+
65
+ describe "#destroy" do
66
+ before do
67
+ Crowd::Client::User.create :username => 'delete@example.com', :password => 'test', :first_name => 'Delete', :last_name => 'Me', :email => 'delete@example.com'
68
+ end
69
+ subject { Crowd::Client::User.new('delete@example.com') }
70
+ it "should delete the user" do
71
+ subject.destroy
72
+ expect { subject.reload! }.should raise_error Crowd::Client::Exception::NotFound, /User/
73
+ end
74
+ end
75
+ end
data/spec/spec_helper.rb CHANGED
@@ -3,9 +3,9 @@
3
3
  require 'vcr'
4
4
  Dir[File.join(File.dirname(__FILE__), "spec/support/**/*.rb")].each {|f| require f}
5
5
 
6
- VCR.config do |c|
6
+ VCR.configure do |c|
7
7
  c.cassette_library_dir = 'spec/cassettes'
8
- c.stub_with :webmock
8
+ c.hook_into :webmock
9
9
  c.default_cassette_options = { :record => :new_episodes, :match_requests_on => [:method, :uri, :body]}
10
10
  end
11
11
 
@@ -20,4 +20,18 @@ RSpec.configure do |config|
20
20
  config.mock_with :rspec
21
21
  config.extend VCR::RSpec::Macros
22
22
 
23
+ vcr_cassette_name_for = lambda do |metadata|
24
+ description = metadata[:description]
25
+
26
+ if example_group = metadata[:example_group]
27
+ [vcr_cassette_name_for[example_group], description].join('/')
28
+ else
29
+ description
30
+ end
31
+ end
32
+
33
+ config.around(:each) do |example|
34
+ cassette_name = vcr_cassette_name_for[example.metadata]
35
+ VCR.use_cassette(cassette_name, &example)
36
+ end
23
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crowd-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-25 00:00:00.000000000Z
12
+ date: 2011-12-21 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70276835498940 !ruby/object:Gem::Requirement
16
+ requirement: &70343742478580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,21 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70276835498940
24
+ version_requirements: *70343742478580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: vcr
27
- requirement: &70276835498340 !ruby/object:Gem::Requirement
27
+ requirement: &70343742478080 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.0.rc1
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70343742478080
36
+ - !ruby/object:Gem::Dependency
37
+ name: webmock
38
+ requirement: &70343742477640 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ! '>='
@@ -32,10 +43,10 @@ dependencies:
32
43
  version: '0'
33
44
  type: :development
34
45
  prerelease: false
35
- version_requirements: *70276835498340
46
+ version_requirements: *70343742477640
36
47
  - !ruby/object:Gem::Dependency
37
- name: webmock
38
- requirement: &70276835497600 !ruby/object:Gem::Requirement
48
+ name: ruby-debug19
49
+ requirement: &70343742477140 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ! '>='
@@ -43,10 +54,10 @@ dependencies:
43
54
  version: '0'
44
55
  type: :development
45
56
  prerelease: false
46
- version_requirements: *70276835497600
57
+ version_requirements: *70343742477140
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: faraday
49
- requirement: &70276835496680 !ruby/object:Gem::Requirement
60
+ requirement: &70343742476620 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - ~>
@@ -54,10 +65,10 @@ dependencies:
54
65
  version: 0.7.5
55
66
  type: :runtime
56
67
  prerelease: false
57
- version_requirements: *70276835496680
68
+ version_requirements: *70343742476620
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: faraday_middleware
60
- requirement: &70276835496060 !ruby/object:Gem::Requirement
71
+ requirement: &70343742476120 !ruby/object:Gem::Requirement
61
72
  none: false
62
73
  requirements:
63
74
  - - ~>
@@ -65,10 +76,10 @@ dependencies:
65
76
  version: 0.7.0
66
77
  type: :runtime
67
78
  prerelease: false
68
- version_requirements: *70276835496060
79
+ version_requirements: *70343742476120
69
80
  - !ruby/object:Gem::Dependency
70
81
  name: patron
71
- requirement: &70276835495120 !ruby/object:Gem::Requirement
82
+ requirement: &70343742475560 !ruby/object:Gem::Requirement
72
83
  none: false
73
84
  requirements:
74
85
  - - ~>
@@ -76,10 +87,10 @@ dependencies:
76
87
  version: 0.4.16
77
88
  type: :runtime
78
89
  prerelease: false
79
- version_requirements: *70276835495120
90
+ version_requirements: *70343742475560
80
91
  - !ruby/object:Gem::Dependency
81
92
  name: json
82
- requirement: &70276835493980 !ruby/object:Gem::Requirement
93
+ requirement: &70343742474900 !ruby/object:Gem::Requirement
83
94
  none: false
84
95
  requirements:
85
96
  - - ~>
@@ -87,7 +98,18 @@ dependencies:
87
98
  version: 1.6.1
88
99
  type: :runtime
89
100
  prerelease: false
90
- version_requirements: *70276835493980
101
+ version_requirements: *70343742474900
102
+ - !ruby/object:Gem::Dependency
103
+ name: activesupport
104
+ requirement: &70343742474440 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 3.1.0
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: *70343742474440
91
113
  description: A simple rest client for Crowd
92
114
  email:
93
115
  - paul@webpowerdesign.net
@@ -102,9 +124,34 @@ files:
102
124
  - crowd-client.gemspec
103
125
  - lib/crowd-client.rb
104
126
  - lib/crowd-client/exceptions.rb
127
+ - lib/crowd-client/group.rb
128
+ - lib/crowd-client/user.rb
105
129
  - lib/crowd-client/version.rb
106
- - spec/cassettes/Crowd_Client.yml
130
+ - spec/cassettes/Crowd_Client/_in_group_/should_confirm_users_are_in_groups.yml
131
+ - spec/cassettes/Crowd_Client/_login/should_authenticate_and_return_a_session_token.yml
132
+ - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_AuthenticationFailed_if_authentication_fails.yml
133
+ - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_InactiveAccount_if_an_account_is_inactive.yml
134
+ - spec/cassettes/Crowd_Client/_logout/should_logout_the_current_session.yml
135
+ - spec/cassettes/Crowd_Client/_user_groups_username_/should_return_the_groups_of_the_user.yml
136
+ - spec/cassettes/Crowd_Client/_user_token_/should_return_the_expanded_user.yml
137
+ - spec/cassettes/Crowd_Client/_valid_session_/should_validate_the_current_session.yml
138
+ - spec/cassettes/Crowd_Client_Group/_add_user/missing_group/should_raise_Exception_NotFound_for_missing_group.yml
139
+ - spec/cassettes/Crowd_Client_Group/_add_user/should_add_the_user.yml
140
+ - spec/cassettes/Crowd_Client_Group/_add_user/should_raise_Exception_NotFound_for_missing_user.yml
141
+ - spec/cassettes/Crowd_Client_Group/_remove_user/should_remove_the_user.yml
142
+ - spec/cassettes/Crowd_Client_Group/_users/should_return_all_of_the_users_in_the_group.yml
143
+ - spec/cassettes/Crowd_Client_User/Creating_a_user/should_create_a_user_with_attributes.yml
144
+ - spec/cassettes/Crowd_Client_User/Get_groups_for_user/should_be_in_the_group.yml
145
+ - spec/cassettes/Crowd_Client_User/Update_user/should_update_user_properties.yml
146
+ - spec/cassettes/Crowd_Client_User/_destroy/should_delete_the_user.yml
147
+ - spec/cassettes/Crowd_Client_User/authenticate/should_return_false_if_the_password_is_invalid.yml
148
+ - spec/cassettes/Crowd_Client_User/authenticate/should_return_true_if_the_password_is_valid.yml
149
+ - spec/cassettes/Crowd_Client_User/change_password/should_allow_the_user_to_set_a_new_password.yml
150
+ - spec/cassettes/Crowd_Client_User/display_name/.yml
151
+ - spec/cassettes/Crowd_Client_User/email/.yml
152
+ - spec/crowd-client_group_spec.rb
107
153
  - spec/crowd-client_spec.rb
154
+ - spec/crowd-client_user_spec.rb
108
155
  - spec/spec_helper.rb
109
156
  homepage: ''
110
157
  licenses: []
@@ -131,6 +178,29 @@ signing_key:
131
178
  specification_version: 3
132
179
  summary: Crowd Client Library
133
180
  test_files:
134
- - spec/cassettes/Crowd_Client.yml
181
+ - spec/cassettes/Crowd_Client/_in_group_/should_confirm_users_are_in_groups.yml
182
+ - spec/cassettes/Crowd_Client/_login/should_authenticate_and_return_a_session_token.yml
183
+ - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_AuthenticationFailed_if_authentication_fails.yml
184
+ - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_InactiveAccount_if_an_account_is_inactive.yml
185
+ - spec/cassettes/Crowd_Client/_logout/should_logout_the_current_session.yml
186
+ - spec/cassettes/Crowd_Client/_user_groups_username_/should_return_the_groups_of_the_user.yml
187
+ - spec/cassettes/Crowd_Client/_user_token_/should_return_the_expanded_user.yml
188
+ - spec/cassettes/Crowd_Client/_valid_session_/should_validate_the_current_session.yml
189
+ - spec/cassettes/Crowd_Client_Group/_add_user/missing_group/should_raise_Exception_NotFound_for_missing_group.yml
190
+ - spec/cassettes/Crowd_Client_Group/_add_user/should_add_the_user.yml
191
+ - spec/cassettes/Crowd_Client_Group/_add_user/should_raise_Exception_NotFound_for_missing_user.yml
192
+ - spec/cassettes/Crowd_Client_Group/_remove_user/should_remove_the_user.yml
193
+ - spec/cassettes/Crowd_Client_Group/_users/should_return_all_of_the_users_in_the_group.yml
194
+ - spec/cassettes/Crowd_Client_User/Creating_a_user/should_create_a_user_with_attributes.yml
195
+ - spec/cassettes/Crowd_Client_User/Get_groups_for_user/should_be_in_the_group.yml
196
+ - spec/cassettes/Crowd_Client_User/Update_user/should_update_user_properties.yml
197
+ - spec/cassettes/Crowd_Client_User/_destroy/should_delete_the_user.yml
198
+ - spec/cassettes/Crowd_Client_User/authenticate/should_return_false_if_the_password_is_invalid.yml
199
+ - spec/cassettes/Crowd_Client_User/authenticate/should_return_true_if_the_password_is_valid.yml
200
+ - spec/cassettes/Crowd_Client_User/change_password/should_allow_the_user_to_set_a_new_password.yml
201
+ - spec/cassettes/Crowd_Client_User/display_name/.yml
202
+ - spec/cassettes/Crowd_Client_User/email/.yml
203
+ - spec/crowd-client_group_spec.rb
135
204
  - spec/crowd-client_spec.rb
205
+ - spec/crowd-client_user_spec.rb
136
206
  - spec/spec_helper.rb
@@ -1,358 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :post
5
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
6
- body: ! '{"username":"user@example.com","password":"wrong_password"}'
7
- headers:
8
- accept:
9
- - application/json
10
- authorization:
11
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
12
- content-type:
13
- - application/json
14
- response: !ruby/struct:VCR::Response
15
- status: !ruby/struct:VCR::ResponseStatus
16
- code: 400
17
- message: Bad Request
18
- headers:
19
- server:
20
- - Apache-Coyote/1.1
21
- x-embedded-crowd-version:
22
- - Crowd/2.3.3
23
- x-crowd-user-management-version:
24
- - '1.1'
25
- set-cookie:
26
- - JSESSIONID=9550A083BC145885EA625E4EA0319F28; Path=/crowd
27
- content-type:
28
- - application/json
29
- transfer-encoding:
30
- - chunked
31
- date:
32
- - Mon, 24 Oct 2011 18:58:17 GMT
33
- body: ! '{"reason":"INVALID_USER_AUTHENTICATION","message":"Failed to authenticate
34
- principal, password was invalid"}'
35
- http_version: '1.1'
36
- - !ruby/struct:VCR::HTTPInteraction
37
- request: !ruby/struct:VCR::Request
38
- method: :post
39
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
40
- body: ! '{"username":"inactive_user@example.com","password":"password"}'
41
- headers:
42
- accept:
43
- - application/json
44
- authorization:
45
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
46
- content-type:
47
- - application/json
48
- response: !ruby/struct:VCR::Response
49
- status: !ruby/struct:VCR::ResponseStatus
50
- code: 400
51
- message: Bad Request
52
- headers:
53
- server:
54
- - Apache-Coyote/1.1
55
- x-embedded-crowd-version:
56
- - Crowd/2.3.3
57
- x-crowd-user-management-version:
58
- - '1.1'
59
- set-cookie:
60
- - JSESSIONID=538F8C6791D51CC4B635EAF46E493691; Path=/crowd
61
- content-type:
62
- - application/json
63
- transfer-encoding:
64
- - chunked
65
- date:
66
- - Mon, 24 Oct 2011 18:58:17 GMT
67
- body: ! '{"reason":"INACTIVE_ACCOUNT","message":"Account with name <inactive_user@example.com>
68
- is inactive"}'
69
- http_version: '1.1'
70
- - !ruby/struct:VCR::HTTPInteraction
71
- request: !ruby/struct:VCR::Request
72
- method: :get
73
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?groupname=MyGroup&username=user@example.com
74
- body: !!null
75
- headers:
76
- accept:
77
- - application/json
78
- authorization:
79
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
80
- response: !ruby/struct:VCR::Response
81
- status: !ruby/struct:VCR::ResponseStatus
82
- code: 200
83
- message: OK
84
- headers:
85
- server:
86
- - Apache-Coyote/1.1
87
- x-embedded-crowd-version:
88
- - Crowd/2.3.3
89
- x-crowd-user-management-version:
90
- - '1.1'
91
- set-cookie:
92
- - JSESSIONID=1E1046E9638FBC0A227A24735412AC24; Path=/crowd
93
- content-type:
94
- - application/json
95
- transfer-encoding:
96
- - chunked
97
- date:
98
- - Mon, 24 Oct 2011 18:58:17 GMT
99
- body: ! '{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/group?groupname=MyGroup","rel":"self"},"name":"MyGroup"}'
100
- http_version: '1.1'
101
- - !ruby/struct:VCR::HTTPInteraction
102
- request: !ruby/struct:VCR::Request
103
- method: :get
104
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?groupname=OtherGroup&username=user@example.com
105
- body: !!null
106
- headers:
107
- accept:
108
- - application/json
109
- authorization:
110
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
111
- response: !ruby/struct:VCR::Response
112
- status: !ruby/struct:VCR::ResponseStatus
113
- code: 404
114
- message: Not Found
115
- headers:
116
- server:
117
- - Apache-Coyote/1.1
118
- x-embedded-crowd-version:
119
- - Crowd/2.3.3
120
- x-crowd-user-management-version:
121
- - '1.1'
122
- set-cookie:
123
- - JSESSIONID=5D83C50BAD0AB7EB1CD1AF59D0C3B528; Path=/crowd
124
- content-type:
125
- - application/json
126
- transfer-encoding:
127
- - chunked
128
- date:
129
- - Mon, 24 Oct 2011 18:58:17 GMT
130
- body: ! '{"reason":"MEMBERSHIP_NOT_FOUND","message":"The child entity <user@example.com>
131
- is not a member of the parent <OtherGroup>"}'
132
- http_version: '1.1'
133
- - !ruby/struct:VCR::HTTPInteraction
134
- request: !ruby/struct:VCR::Request
135
- method: :get
136
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00?expand=user
137
- body: !!null
138
- headers:
139
- accept:
140
- - application/json
141
- authorization:
142
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
143
- response: !ruby/struct:VCR::Response
144
- status: !ruby/struct:VCR::ResponseStatus
145
- code: 200
146
- message: OK
147
- headers:
148
- server:
149
- - Apache-Coyote/1.1
150
- x-embedded-crowd-version:
151
- - Crowd/2.3.3
152
- x-crowd-user-management-version:
153
- - '1.1'
154
- set-cookie:
155
- - JSESSIONID=157F91CED1028584293EF2E88508B6AC; Path=/crowd
156
- content-type:
157
- - application/json
158
- transfer-encoding:
159
- - chunked
160
- date:
161
- - Mon, 24 Oct 2011 18:58:17 GMT
162
- body: ! '{"expand":"user","token":"HRz7gjbhx0vl6QnYRHKDjQ00","user":{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/user?username=user@example.com","rel":"self"},"name":"user@example.com","first-name":"Example","last-name":"User","display-name":"Example
163
- User","email":"user@example.com","password":{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/password?username=user@example.com","rel":"edit"}},"active":true,"attributes":{"attributes":[],"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/attribute?username=user@example.com","rel":"self"}}},"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00","rel":"self"}}'
164
- http_version: '1.1'
165
- - !ruby/struct:VCR::HTTPInteraction
166
- request: !ruby/struct:VCR::Request
167
- method: :get
168
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?username=user@example.com
169
- body: !!null
170
- headers:
171
- accept:
172
- - application/json
173
- authorization:
174
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
175
- response: !ruby/struct:VCR::Response
176
- status: !ruby/struct:VCR::ResponseStatus
177
- code: 200
178
- message: OK
179
- headers:
180
- server:
181
- - Apache-Coyote/1.1
182
- x-embedded-crowd-version:
183
- - Crowd/2.3.3
184
- x-crowd-user-management-version:
185
- - '1.1'
186
- set-cookie:
187
- - JSESSIONID=1D4201195A8CDA7F90F1AF4CA6442A53; Path=/crowd
188
- content-type:
189
- - application/json
190
- transfer-encoding:
191
- - chunked
192
- date:
193
- - Mon, 24 Oct 2011 18:58:17 GMT
194
- body: ! '{"expand":"group","groups":[{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/group?groupname=MyGroup","rel":"self"},"name":"MyGroup"},{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/group?groupname=users","rel":"self"},"name":"users"}]}'
195
- http_version: '1.1'
196
- - !ruby/struct:VCR::HTTPInteraction
197
- request: !ruby/struct:VCR::Request
198
- method: :get
199
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?username=user@example.com
200
- body: !!null
201
- headers:
202
- accept:
203
- - application/json
204
- authorization:
205
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
206
- response: !ruby/struct:VCR::Response
207
- status: !ruby/struct:VCR::ResponseStatus
208
- code: 200
209
- message: OK
210
- headers:
211
- server:
212
- - Apache-Coyote/1.1
213
- x-embedded-crowd-version:
214
- - Crowd/2.3.3
215
- x-crowd-user-management-version:
216
- - '1.1'
217
- set-cookie:
218
- - JSESSIONID=D475E1A06E78071C5AB66C48FCEBA727; Path=/crowd
219
- content-type:
220
- - application/json
221
- transfer-encoding:
222
- - chunked
223
- date:
224
- - Mon, 24 Oct 2011 18:58:18 GMT
225
- body: ! '{"expand":"group","groups":[{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/group?groupname=MyGroup","rel":"self"},"name":"MyGroup"},{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/group?groupname=users","rel":"self"},"name":"users"}]}'
226
- http_version: '1.1'
227
- - !ruby/struct:VCR::HTTPInteraction
228
- request: !ruby/struct:VCR::Request
229
- method: :post
230
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
231
- body: ! '{"username":"user@example.com","password":"password"}'
232
- headers:
233
- accept:
234
- - application/json
235
- authorization:
236
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
237
- content-type:
238
- - application/json
239
- response: !ruby/struct:VCR::Response
240
- status: !ruby/struct:VCR::ResponseStatus
241
- code: 201
242
- message: Created
243
- headers:
244
- server:
245
- - Apache-Coyote/1.1
246
- x-embedded-crowd-version:
247
- - Crowd/2.3.3
248
- x-crowd-user-management-version:
249
- - '1.1'
250
- set-cookie:
251
- - JSESSIONID=DE53C317530856E2808D9A877345941A; Path=/crowd
252
- cache-control:
253
- - no-cache, no-store, no-transform
254
- location:
255
- - http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
256
- content-type:
257
- - application/json
258
- transfer-encoding:
259
- - chunked
260
- date:
261
- - Mon, 24 Oct 2011 18:58:18 GMT
262
- body: ! '{"expand":"user","token":"HRz7gjbhx0vl6QnYRHKDjQ00","user":{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/user?username=user@example.com","rel":"self"},"name":"user@example.com"},"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00","rel":"self"}}'
263
- http_version: '1.1'
264
- - !ruby/struct:VCR::HTTPInteraction
265
- request: !ruby/struct:VCR::Request
266
- method: :post
267
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
268
- body: ! '{}'
269
- headers:
270
- accept:
271
- - application/json
272
- authorization:
273
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
274
- content-type:
275
- - application/json
276
- response: !ruby/struct:VCR::Response
277
- status: !ruby/struct:VCR::ResponseStatus
278
- code: 200
279
- message: OK
280
- headers:
281
- server:
282
- - Apache-Coyote/1.1
283
- x-embedded-crowd-version:
284
- - Crowd/2.3.3
285
- x-crowd-user-management-version:
286
- - '1.1'
287
- set-cookie:
288
- - JSESSIONID=8DE379BB9A6B565E8A85E42830D2C2CF; Path=/crowd
289
- cache-control:
290
- - no-cache, no-store, no-transform
291
- content-type:
292
- - application/json
293
- transfer-encoding:
294
- - chunked
295
- date:
296
- - Mon, 24 Oct 2011 18:58:18 GMT
297
- body: ! '{"expand":"user","token":"HRz7gjbhx0vl6QnYRHKDjQ00","user":{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/user?username=user@example.com","rel":"self"},"name":"user@example.com"},"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00","rel":"self"}}'
298
- http_version: '1.1'
299
- - !ruby/struct:VCR::HTTPInteraction
300
- request: !ruby/struct:VCR::Request
301
- method: :delete
302
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
303
- body: !!null
304
- headers:
305
- accept:
306
- - application/json
307
- authorization:
308
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
309
- response: !ruby/struct:VCR::Response
310
- status: !ruby/struct:VCR::ResponseStatus
311
- code: 204
312
- message: No Content
313
- headers:
314
- server:
315
- - Apache-Coyote/1.1
316
- x-embedded-crowd-version:
317
- - Crowd/2.3.3
318
- x-crowd-user-management-version:
319
- - '1.1'
320
- set-cookie:
321
- - JSESSIONID=4D3AE20269AFC73F3A063B8C3A47CF83; Path=/crowd
322
- date:
323
- - Mon, 24 Oct 2011 18:58:18 GMT
324
- body: !!null
325
- http_version: '1.1'
326
- - !ruby/struct:VCR::HTTPInteraction
327
- request: !ruby/struct:VCR::Request
328
- method: :post
329
- uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
330
- body: ! '{}'
331
- headers:
332
- accept:
333
- - application/json
334
- authorization:
335
- - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
336
- content-type:
337
- - application/json
338
- response: !ruby/struct:VCR::Response
339
- status: !ruby/struct:VCR::ResponseStatus
340
- code: 404
341
- message: Not Found
342
- headers:
343
- server:
344
- - Apache-Coyote/1.1
345
- x-embedded-crowd-version:
346
- - Crowd/2.3.3
347
- x-crowd-user-management-version:
348
- - '1.1'
349
- set-cookie:
350
- - JSESSIONID=8F33832C59536DAB7933396D8D953BC5; Path=/crowd
351
- content-type:
352
- - application/json
353
- transfer-encoding:
354
- - chunked
355
- date:
356
- - Mon, 24 Oct 2011 18:58:18 GMT
357
- body: ! '{"reason":"INVALID_SSO_TOKEN","message":"Token does not validate."}'
358
- http_version: '1.1'