crowd-client 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rvmrc +1 -0
- data/lib/crowd-client.rb +14 -0
- data/lib/crowd-client/version.rb +1 -1
- data/spec/cassettes/Crowd_Client.yml +57 -609
- data/spec/crowd-client_spec.rb +15 -0
- metadata +16 -15
data/.rvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rvm use 1.9.2
|
data/lib/crowd-client.rb
CHANGED
|
@@ -39,6 +39,20 @@ module Crowd
|
|
|
39
39
|
raise Exception::UnkownError if response.status != 204
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
def user(token)
|
|
43
|
+
response = connection.get("session/#{token}") do |request|
|
|
44
|
+
request.params[:expand] = 'user'
|
|
45
|
+
end
|
|
46
|
+
response.body['user']
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def user_groups(username)
|
|
50
|
+
response = connection.get("user/group/nested") do |request|
|
|
51
|
+
request.params[:username] = username
|
|
52
|
+
end
|
|
53
|
+
response.body['groups'].collect{|group| group['name']}
|
|
54
|
+
end
|
|
55
|
+
|
|
42
56
|
def in_group?(username, group_name)
|
|
43
57
|
response = connection.get("user/group/nested") do |request|
|
|
44
58
|
request.params[:username] = username
|
data/lib/crowd-client/version.rb
CHANGED
|
@@ -1,334 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
3
|
-
request: !ruby/struct:VCR::Request
|
|
4
|
-
method: :get
|
|
5
|
-
uri: http://127.0.0.1:8095/user/group/nested
|
|
6
|
-
body: !!null
|
|
7
|
-
headers:
|
|
8
|
-
accept:
|
|
9
|
-
- application/json
|
|
10
|
-
authorization:
|
|
11
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
12
|
-
username:
|
|
13
|
-
- user@example.com
|
|
14
|
-
groupname:
|
|
15
|
-
- MyGroup
|
|
16
|
-
response: !ruby/struct:VCR::Response
|
|
17
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
18
|
-
code: 404
|
|
19
|
-
message: Not Found
|
|
20
|
-
headers:
|
|
21
|
-
server:
|
|
22
|
-
- Apache-Coyote/1.1
|
|
23
|
-
content-type:
|
|
24
|
-
- text/html;charset=utf-8
|
|
25
|
-
content-length:
|
|
26
|
-
- '1006'
|
|
27
|
-
date:
|
|
28
|
-
- Mon, 24 Oct 2011 17:41:27 GMT
|
|
29
|
-
body: ! '<html><head><title>Apache Tomcat/6.0.32 - Error report</title><style><!--H1
|
|
30
|
-
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
|
|
31
|
-
H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
|
|
32
|
-
H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
|
|
33
|
-
BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
|
|
34
|
-
B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
|
|
35
|
-
P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
|
|
36
|
-
{color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP
|
|
37
|
-
Status 404 - /user/group/nested</h1><HR size="1" noshade="noshade"><p><b>type</b>
|
|
38
|
-
Status report</p><p><b>message</b> <u>/user/group/nested</u></p><p><b>description</b>
|
|
39
|
-
<u>The requested resource (/user/group/nested) is not available.</u></p><HR
|
|
40
|
-
size="1" noshade="noshade"><h3>Apache Tomcat/6.0.32</h3></body></html>'
|
|
41
|
-
http_version: '1.1'
|
|
42
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
43
|
-
request: !ruby/struct:VCR::Request
|
|
44
|
-
method: :post
|
|
45
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/akoqHwkAqtQHtriHaHKfwA00
|
|
46
|
-
body: ! '{}'
|
|
47
|
-
headers:
|
|
48
|
-
accept:
|
|
49
|
-
- application/json
|
|
50
|
-
authorization:
|
|
51
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
52
|
-
content-type:
|
|
53
|
-
- application/json
|
|
54
|
-
response: !ruby/struct:VCR::Response
|
|
55
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
56
|
-
code: 200
|
|
57
|
-
message: OK
|
|
58
|
-
headers:
|
|
59
|
-
server:
|
|
60
|
-
- Apache-Coyote/1.1
|
|
61
|
-
x-embedded-crowd-version:
|
|
62
|
-
- Crowd/2.3.3
|
|
63
|
-
x-crowd-user-management-version:
|
|
64
|
-
- '1.1'
|
|
65
|
-
set-cookie:
|
|
66
|
-
- JSESSIONID=E3B16E4957759AA15D493512E36E5DDE; Path=/crowd
|
|
67
|
-
cache-control:
|
|
68
|
-
- no-cache, no-store, no-transform
|
|
69
|
-
content-type:
|
|
70
|
-
- application/json
|
|
71
|
-
transfer-encoding:
|
|
72
|
-
- chunked
|
|
73
|
-
date:
|
|
74
|
-
- Mon, 24 Oct 2011 17:41:27 GMT
|
|
75
|
-
body: ! '{"expand":"user","token":"akoqHwkAqtQHtriHaHKfwA00","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/akoqHwkAqtQHtriHaHKfwA00","rel":"self"}}'
|
|
76
|
-
http_version: '1.1'
|
|
77
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
78
|
-
request: !ruby/struct:VCR::Request
|
|
79
|
-
method: :delete
|
|
80
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/akoqHwkAqtQHtriHaHKfwA00
|
|
81
|
-
body: !!null
|
|
82
|
-
headers:
|
|
83
|
-
accept:
|
|
84
|
-
- application/json
|
|
85
|
-
authorization:
|
|
86
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
87
|
-
response: !ruby/struct:VCR::Response
|
|
88
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
89
|
-
code: 204
|
|
90
|
-
message: No Content
|
|
91
|
-
headers:
|
|
92
|
-
server:
|
|
93
|
-
- Apache-Coyote/1.1
|
|
94
|
-
x-embedded-crowd-version:
|
|
95
|
-
- Crowd/2.3.3
|
|
96
|
-
x-crowd-user-management-version:
|
|
97
|
-
- '1.1'
|
|
98
|
-
set-cookie:
|
|
99
|
-
- JSESSIONID=7DB3CA4FD107004EBD7B80A3444A5DF5; Path=/crowd
|
|
100
|
-
date:
|
|
101
|
-
- Mon, 24 Oct 2011 17:41:27 GMT
|
|
102
|
-
body: !!null
|
|
103
|
-
http_version: '1.1'
|
|
104
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
105
|
-
request: !ruby/struct:VCR::Request
|
|
106
|
-
method: :post
|
|
107
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/akoqHwkAqtQHtriHaHKfwA00
|
|
108
|
-
body: ! '{}'
|
|
109
|
-
headers:
|
|
110
|
-
accept:
|
|
111
|
-
- application/json
|
|
112
|
-
authorization:
|
|
113
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
114
|
-
content-type:
|
|
115
|
-
- application/json
|
|
116
|
-
response: !ruby/struct:VCR::Response
|
|
117
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
118
|
-
code: 404
|
|
119
|
-
message: Not Found
|
|
120
|
-
headers:
|
|
121
|
-
server:
|
|
122
|
-
- Apache-Coyote/1.1
|
|
123
|
-
x-embedded-crowd-version:
|
|
124
|
-
- Crowd/2.3.3
|
|
125
|
-
x-crowd-user-management-version:
|
|
126
|
-
- '1.1'
|
|
127
|
-
set-cookie:
|
|
128
|
-
- JSESSIONID=3F4377B74E289159EB2093D7DBBA35A5; Path=/crowd
|
|
129
|
-
content-type:
|
|
130
|
-
- application/json
|
|
131
|
-
transfer-encoding:
|
|
132
|
-
- chunked
|
|
133
|
-
date:
|
|
134
|
-
- Mon, 24 Oct 2011 17:41:27 GMT
|
|
135
|
-
body: ! '{"reason":"INVALID_SSO_TOKEN","message":"Token does not validate."}'
|
|
136
|
-
http_version: '1.1'
|
|
137
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
138
|
-
request: !ruby/struct:VCR::Request
|
|
139
|
-
method: :post
|
|
140
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/cMPdTh8dEd586Z8pFpoc8g00
|
|
141
|
-
body: ! '{}'
|
|
142
|
-
headers:
|
|
143
|
-
accept:
|
|
144
|
-
- application/json
|
|
145
|
-
authorization:
|
|
146
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
147
|
-
content-type:
|
|
148
|
-
- application/json
|
|
149
|
-
response: !ruby/struct:VCR::Response
|
|
150
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
151
|
-
code: 200
|
|
152
|
-
message: OK
|
|
153
|
-
headers:
|
|
154
|
-
server:
|
|
155
|
-
- Apache-Coyote/1.1
|
|
156
|
-
x-embedded-crowd-version:
|
|
157
|
-
- Crowd/2.3.3
|
|
158
|
-
x-crowd-user-management-version:
|
|
159
|
-
- '1.1'
|
|
160
|
-
set-cookie:
|
|
161
|
-
- JSESSIONID=E190FCEDC0E0F3EC04A4110F336716DA; Path=/crowd
|
|
162
|
-
cache-control:
|
|
163
|
-
- no-cache, no-store, no-transform
|
|
164
|
-
content-type:
|
|
165
|
-
- application/json
|
|
166
|
-
transfer-encoding:
|
|
167
|
-
- chunked
|
|
168
|
-
date:
|
|
169
|
-
- Mon, 24 Oct 2011 17:42:22 GMT
|
|
170
|
-
body: ! '{"expand":"user","token":"cMPdTh8dEd586Z8pFpoc8g00","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/cMPdTh8dEd586Z8pFpoc8g00","rel":"self"}}'
|
|
171
|
-
http_version: '1.1'
|
|
172
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
173
|
-
request: !ruby/struct:VCR::Request
|
|
174
|
-
method: :delete
|
|
175
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/cMPdTh8dEd586Z8pFpoc8g00
|
|
176
|
-
body: !!null
|
|
177
|
-
headers:
|
|
178
|
-
accept:
|
|
179
|
-
- application/json
|
|
180
|
-
authorization:
|
|
181
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
182
|
-
response: !ruby/struct:VCR::Response
|
|
183
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
184
|
-
code: 204
|
|
185
|
-
message: No Content
|
|
186
|
-
headers:
|
|
187
|
-
server:
|
|
188
|
-
- Apache-Coyote/1.1
|
|
189
|
-
x-embedded-crowd-version:
|
|
190
|
-
- Crowd/2.3.3
|
|
191
|
-
x-crowd-user-management-version:
|
|
192
|
-
- '1.1'
|
|
193
|
-
set-cookie:
|
|
194
|
-
- JSESSIONID=EF59322E28B415D3606CAE145B9D44A8; Path=/crowd
|
|
195
|
-
date:
|
|
196
|
-
- Mon, 24 Oct 2011 17:42:22 GMT
|
|
197
|
-
body: !!null
|
|
198
|
-
http_version: '1.1'
|
|
199
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
200
|
-
request: !ruby/struct:VCR::Request
|
|
201
|
-
method: :post
|
|
202
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/cMPdTh8dEd586Z8pFpoc8g00
|
|
203
|
-
body: ! '{}'
|
|
204
|
-
headers:
|
|
205
|
-
accept:
|
|
206
|
-
- application/json
|
|
207
|
-
authorization:
|
|
208
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
209
|
-
content-type:
|
|
210
|
-
- application/json
|
|
211
|
-
response: !ruby/struct:VCR::Response
|
|
212
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
213
|
-
code: 404
|
|
214
|
-
message: Not Found
|
|
215
|
-
headers:
|
|
216
|
-
server:
|
|
217
|
-
- Apache-Coyote/1.1
|
|
218
|
-
x-embedded-crowd-version:
|
|
219
|
-
- Crowd/2.3.3
|
|
220
|
-
x-crowd-user-management-version:
|
|
221
|
-
- '1.1'
|
|
222
|
-
set-cookie:
|
|
223
|
-
- JSESSIONID=905E33DD1C4EE45752732C847045D273; Path=/crowd
|
|
224
|
-
content-type:
|
|
225
|
-
- application/json
|
|
226
|
-
transfer-encoding:
|
|
227
|
-
- chunked
|
|
228
|
-
date:
|
|
229
|
-
- Mon, 24 Oct 2011 17:42:22 GMT
|
|
230
|
-
body: ! '{"reason":"INVALID_SSO_TOKEN","message":"Token does not validate."}'
|
|
231
|
-
http_version: '1.1'
|
|
232
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
233
|
-
request: !ruby/struct:VCR::Request
|
|
234
|
-
method: :post
|
|
235
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/PY2wAuVlJcwulTnBP5FIbQ00
|
|
236
|
-
body: ! '{}'
|
|
237
|
-
headers:
|
|
238
|
-
accept:
|
|
239
|
-
- application/json
|
|
240
|
-
authorization:
|
|
241
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
242
|
-
content-type:
|
|
243
|
-
- application/json
|
|
244
|
-
response: !ruby/struct:VCR::Response
|
|
245
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
246
|
-
code: 200
|
|
247
|
-
message: OK
|
|
248
|
-
headers:
|
|
249
|
-
server:
|
|
250
|
-
- Apache-Coyote/1.1
|
|
251
|
-
x-embedded-crowd-version:
|
|
252
|
-
- Crowd/2.3.3
|
|
253
|
-
x-crowd-user-management-version:
|
|
254
|
-
- '1.1'
|
|
255
|
-
set-cookie:
|
|
256
|
-
- JSESSIONID=79CEC57B4545DFB4CEEF4DBFA12EF484; Path=/crowd
|
|
257
|
-
cache-control:
|
|
258
|
-
- no-cache, no-store, no-transform
|
|
259
|
-
content-type:
|
|
260
|
-
- application/json
|
|
261
|
-
transfer-encoding:
|
|
262
|
-
- chunked
|
|
263
|
-
date:
|
|
264
|
-
- Mon, 24 Oct 2011 17:42:59 GMT
|
|
265
|
-
body: ! '{"expand":"user","token":"PY2wAuVlJcwulTnBP5FIbQ00","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/PY2wAuVlJcwulTnBP5FIbQ00","rel":"self"}}'
|
|
266
|
-
http_version: '1.1'
|
|
267
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
268
|
-
request: !ruby/struct:VCR::Request
|
|
269
|
-
method: :delete
|
|
270
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/PY2wAuVlJcwulTnBP5FIbQ00
|
|
271
|
-
body: !!null
|
|
272
|
-
headers:
|
|
273
|
-
accept:
|
|
274
|
-
- application/json
|
|
275
|
-
authorization:
|
|
276
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
277
|
-
response: !ruby/struct:VCR::Response
|
|
278
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
279
|
-
code: 204
|
|
280
|
-
message: No Content
|
|
281
|
-
headers:
|
|
282
|
-
server:
|
|
283
|
-
- Apache-Coyote/1.1
|
|
284
|
-
x-embedded-crowd-version:
|
|
285
|
-
- Crowd/2.3.3
|
|
286
|
-
x-crowd-user-management-version:
|
|
287
|
-
- '1.1'
|
|
288
|
-
set-cookie:
|
|
289
|
-
- JSESSIONID=B1A18D07B87E284D8C336656294181AC; Path=/crowd
|
|
290
|
-
date:
|
|
291
|
-
- Mon, 24 Oct 2011 17:42:59 GMT
|
|
292
|
-
body: !!null
|
|
293
|
-
http_version: '1.1'
|
|
294
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
295
|
-
request: !ruby/struct:VCR::Request
|
|
296
|
-
method: :post
|
|
297
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/PY2wAuVlJcwulTnBP5FIbQ00
|
|
298
|
-
body: ! '{}'
|
|
299
|
-
headers:
|
|
300
|
-
accept:
|
|
301
|
-
- application/json
|
|
302
|
-
authorization:
|
|
303
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
304
|
-
content-type:
|
|
305
|
-
- application/json
|
|
306
|
-
response: !ruby/struct:VCR::Response
|
|
307
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
308
|
-
code: 404
|
|
309
|
-
message: Not Found
|
|
310
|
-
headers:
|
|
311
|
-
server:
|
|
312
|
-
- Apache-Coyote/1.1
|
|
313
|
-
x-embedded-crowd-version:
|
|
314
|
-
- Crowd/2.3.3
|
|
315
|
-
x-crowd-user-management-version:
|
|
316
|
-
- '1.1'
|
|
317
|
-
set-cookie:
|
|
318
|
-
- JSESSIONID=CF4BEA4A9616CFCBD6ED5A94909F1A1E; Path=/crowd
|
|
319
|
-
content-type:
|
|
320
|
-
- application/json
|
|
321
|
-
transfer-encoding:
|
|
322
|
-
- chunked
|
|
323
|
-
date:
|
|
324
|
-
- Mon, 24 Oct 2011 17:43:00 GMT
|
|
325
|
-
body: ! '{"reason":"INVALID_SSO_TOKEN","message":"Token does not validate."}'
|
|
326
|
-
http_version: '1.1'
|
|
327
2
|
- !ruby/struct:VCR::HTTPInteraction
|
|
328
3
|
request: !ruby/struct:VCR::Request
|
|
329
4
|
method: :post
|
|
330
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
|
|
331
|
-
body: ! '{}'
|
|
5
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
|
|
6
|
+
body: ! '{"username":"user@example.com","password":"wrong_password"}'
|
|
332
7
|
headers:
|
|
333
8
|
accept:
|
|
334
9
|
- application/json
|
|
@@ -338,8 +13,8 @@
|
|
|
338
13
|
- application/json
|
|
339
14
|
response: !ruby/struct:VCR::Response
|
|
340
15
|
status: !ruby/struct:VCR::ResponseStatus
|
|
341
|
-
code:
|
|
342
|
-
message:
|
|
16
|
+
code: 400
|
|
17
|
+
message: Bad Request
|
|
343
18
|
headers:
|
|
344
19
|
server:
|
|
345
20
|
- Apache-Coyote/1.1
|
|
@@ -348,49 +23,21 @@
|
|
|
348
23
|
x-crowd-user-management-version:
|
|
349
24
|
- '1.1'
|
|
350
25
|
set-cookie:
|
|
351
|
-
- JSESSIONID=
|
|
352
|
-
cache-control:
|
|
353
|
-
- no-cache, no-store, no-transform
|
|
26
|
+
- JSESSIONID=9550A083BC145885EA625E4EA0319F28; Path=/crowd
|
|
354
27
|
content-type:
|
|
355
28
|
- application/json
|
|
356
29
|
transfer-encoding:
|
|
357
30
|
- chunked
|
|
358
31
|
date:
|
|
359
|
-
- Mon, 24 Oct 2011
|
|
360
|
-
body: ! '{"
|
|
361
|
-
|
|
362
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
363
|
-
request: !ruby/struct:VCR::Request
|
|
364
|
-
method: :delete
|
|
365
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/P0dncW093f0cOMGCd0OG4A00
|
|
366
|
-
body: !!null
|
|
367
|
-
headers:
|
|
368
|
-
accept:
|
|
369
|
-
- application/json
|
|
370
|
-
authorization:
|
|
371
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
372
|
-
response: !ruby/struct:VCR::Response
|
|
373
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
374
|
-
code: 204
|
|
375
|
-
message: No Content
|
|
376
|
-
headers:
|
|
377
|
-
server:
|
|
378
|
-
- Apache-Coyote/1.1
|
|
379
|
-
x-embedded-crowd-version:
|
|
380
|
-
- Crowd/2.3.3
|
|
381
|
-
x-crowd-user-management-version:
|
|
382
|
-
- '1.1'
|
|
383
|
-
set-cookie:
|
|
384
|
-
- JSESSIONID=A7D101ABF814F975C9012762F223CCF2; Path=/crowd
|
|
385
|
-
date:
|
|
386
|
-
- Mon, 24 Oct 2011 17:45:16 GMT
|
|
387
|
-
body: !!null
|
|
32
|
+
- Mon, 24 Oct 2011 18:58:17 GMT
|
|
33
|
+
body: ! '{"reason":"INVALID_USER_AUTHENTICATION","message":"Failed to authenticate
|
|
34
|
+
principal, password was invalid"}'
|
|
388
35
|
http_version: '1.1'
|
|
389
36
|
- !ruby/struct:VCR::HTTPInteraction
|
|
390
37
|
request: !ruby/struct:VCR::Request
|
|
391
38
|
method: :post
|
|
392
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
|
|
393
|
-
body: ! '{}'
|
|
39
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
|
|
40
|
+
body: ! '{"username":"inactive_user@example.com","password":"password"}'
|
|
394
41
|
headers:
|
|
395
42
|
accept:
|
|
396
43
|
- application/json
|
|
@@ -400,8 +47,8 @@
|
|
|
400
47
|
- application/json
|
|
401
48
|
response: !ruby/struct:VCR::Response
|
|
402
49
|
status: !ruby/struct:VCR::ResponseStatus
|
|
403
|
-
code:
|
|
404
|
-
message:
|
|
50
|
+
code: 400
|
|
51
|
+
message: Bad Request
|
|
405
52
|
headers:
|
|
406
53
|
server:
|
|
407
54
|
- Apache-Coyote/1.1
|
|
@@ -410,27 +57,26 @@
|
|
|
410
57
|
x-crowd-user-management-version:
|
|
411
58
|
- '1.1'
|
|
412
59
|
set-cookie:
|
|
413
|
-
- JSESSIONID=
|
|
60
|
+
- JSESSIONID=538F8C6791D51CC4B635EAF46E493691; Path=/crowd
|
|
414
61
|
content-type:
|
|
415
62
|
- application/json
|
|
416
63
|
transfer-encoding:
|
|
417
64
|
- chunked
|
|
418
65
|
date:
|
|
419
|
-
- Mon, 24 Oct 2011
|
|
420
|
-
body: ! '{"reason":"
|
|
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"}'
|
|
421
69
|
http_version: '1.1'
|
|
422
70
|
- !ruby/struct:VCR::HTTPInteraction
|
|
423
71
|
request: !ruby/struct:VCR::Request
|
|
424
|
-
method: :
|
|
425
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/
|
|
426
|
-
body:
|
|
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
|
|
427
75
|
headers:
|
|
428
76
|
accept:
|
|
429
77
|
- application/json
|
|
430
78
|
authorization:
|
|
431
79
|
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
432
|
-
content-type:
|
|
433
|
-
- application/json
|
|
434
80
|
response: !ruby/struct:VCR::Response
|
|
435
81
|
status: !ruby/struct:VCR::ResponseStatus
|
|
436
82
|
code: 200
|
|
@@ -443,56 +89,25 @@
|
|
|
443
89
|
x-crowd-user-management-version:
|
|
444
90
|
- '1.1'
|
|
445
91
|
set-cookie:
|
|
446
|
-
- JSESSIONID=
|
|
447
|
-
cache-control:
|
|
448
|
-
- no-cache, no-store, no-transform
|
|
92
|
+
- JSESSIONID=1E1046E9638FBC0A227A24735412AC24; Path=/crowd
|
|
449
93
|
content-type:
|
|
450
94
|
- application/json
|
|
451
95
|
transfer-encoding:
|
|
452
96
|
- chunked
|
|
453
97
|
date:
|
|
454
|
-
- Mon, 24 Oct 2011
|
|
455
|
-
body: ! '{"
|
|
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"}'
|
|
456
100
|
http_version: '1.1'
|
|
457
101
|
- !ruby/struct:VCR::HTTPInteraction
|
|
458
102
|
request: !ruby/struct:VCR::Request
|
|
459
|
-
method: :
|
|
460
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/
|
|
461
|
-
body: !!null
|
|
462
|
-
headers:
|
|
463
|
-
accept:
|
|
464
|
-
- application/json
|
|
465
|
-
authorization:
|
|
466
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
467
|
-
response: !ruby/struct:VCR::Response
|
|
468
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
469
|
-
code: 204
|
|
470
|
-
message: No Content
|
|
471
|
-
headers:
|
|
472
|
-
server:
|
|
473
|
-
- Apache-Coyote/1.1
|
|
474
|
-
x-embedded-crowd-version:
|
|
475
|
-
- Crowd/2.3.3
|
|
476
|
-
x-crowd-user-management-version:
|
|
477
|
-
- '1.1'
|
|
478
|
-
set-cookie:
|
|
479
|
-
- JSESSIONID=486D79AB6412A27EAF225AA8FD0A8DAE; Path=/crowd
|
|
480
|
-
date:
|
|
481
|
-
- Mon, 24 Oct 2011 17:46:16 GMT
|
|
103
|
+
method: :get
|
|
104
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?groupname=OtherGroup&username=user@example.com
|
|
482
105
|
body: !!null
|
|
483
|
-
http_version: '1.1'
|
|
484
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
485
|
-
request: !ruby/struct:VCR::Request
|
|
486
|
-
method: :post
|
|
487
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/USsWljgK06dsd0DHDBnVMA00
|
|
488
|
-
body: ! '{}'
|
|
489
106
|
headers:
|
|
490
107
|
accept:
|
|
491
108
|
- application/json
|
|
492
109
|
authorization:
|
|
493
110
|
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
494
|
-
content-type:
|
|
495
|
-
- application/json
|
|
496
111
|
response: !ruby/struct:VCR::Response
|
|
497
112
|
status: !ruby/struct:VCR::ResponseStatus
|
|
498
113
|
code: 404
|
|
@@ -505,63 +120,26 @@
|
|
|
505
120
|
x-crowd-user-management-version:
|
|
506
121
|
- '1.1'
|
|
507
122
|
set-cookie:
|
|
508
|
-
- JSESSIONID=
|
|
123
|
+
- JSESSIONID=5D83C50BAD0AB7EB1CD1AF59D0C3B528; Path=/crowd
|
|
509
124
|
content-type:
|
|
510
125
|
- application/json
|
|
511
126
|
transfer-encoding:
|
|
512
127
|
- chunked
|
|
513
128
|
date:
|
|
514
|
-
- Mon, 24 Oct 2011
|
|
515
|
-
body: ! '{"reason":"
|
|
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>"}'
|
|
516
132
|
http_version: '1.1'
|
|
517
133
|
- !ruby/struct:VCR::HTTPInteraction
|
|
518
134
|
request: !ruby/struct:VCR::Request
|
|
519
135
|
method: :get
|
|
520
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user
|
|
136
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00?expand=user
|
|
521
137
|
body: !!null
|
|
522
138
|
headers:
|
|
523
139
|
accept:
|
|
524
140
|
- application/json
|
|
525
141
|
authorization:
|
|
526
142
|
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
527
|
-
username:
|
|
528
|
-
- user@example.com
|
|
529
|
-
groupname:
|
|
530
|
-
- MyGroup
|
|
531
|
-
response: !ruby/struct:VCR::Response
|
|
532
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
533
|
-
code: 400
|
|
534
|
-
message: Bad Request
|
|
535
|
-
headers:
|
|
536
|
-
server:
|
|
537
|
-
- Apache-Coyote/1.1
|
|
538
|
-
x-embedded-crowd-version:
|
|
539
|
-
- Crowd/2.3.3
|
|
540
|
-
x-crowd-user-management-version:
|
|
541
|
-
- '1.1'
|
|
542
|
-
set-cookie:
|
|
543
|
-
- JSESSIONID=504AEE176C5C63D321513207BB9E55DB; Path=/crowd
|
|
544
|
-
content-type:
|
|
545
|
-
- application/json
|
|
546
|
-
transfer-encoding:
|
|
547
|
-
- chunked
|
|
548
|
-
date:
|
|
549
|
-
- Mon, 24 Oct 2011 17:46:48 GMT
|
|
550
|
-
body: ! '{"reason":"ILLEGAL_ARGUMENT","message":"username query parameter must
|
|
551
|
-
be given"}'
|
|
552
|
-
http_version: '1.1'
|
|
553
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
554
|
-
request: !ruby/struct:VCR::Request
|
|
555
|
-
method: :post
|
|
556
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/XZ0sHLGWuTFoIjwNFa1eWw00
|
|
557
|
-
body: ! '{}'
|
|
558
|
-
headers:
|
|
559
|
-
accept:
|
|
560
|
-
- application/json
|
|
561
|
-
authorization:
|
|
562
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
563
|
-
content-type:
|
|
564
|
-
- application/json
|
|
565
143
|
response: !ruby/struct:VCR::Response
|
|
566
144
|
status: !ruby/struct:VCR::ResponseStatus
|
|
567
145
|
code: 200
|
|
@@ -574,149 +152,20 @@
|
|
|
574
152
|
x-crowd-user-management-version:
|
|
575
153
|
- '1.1'
|
|
576
154
|
set-cookie:
|
|
577
|
-
- JSESSIONID=
|
|
578
|
-
cache-control:
|
|
579
|
-
- no-cache, no-store, no-transform
|
|
580
|
-
content-type:
|
|
581
|
-
- application/json
|
|
582
|
-
transfer-encoding:
|
|
583
|
-
- chunked
|
|
584
|
-
date:
|
|
585
|
-
- Mon, 24 Oct 2011 17:51:35 GMT
|
|
586
|
-
body: ! '{"expand":"user","token":"XZ0sHLGWuTFoIjwNFa1eWw00","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/XZ0sHLGWuTFoIjwNFa1eWw00","rel":"self"}}'
|
|
587
|
-
http_version: '1.1'
|
|
588
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
589
|
-
request: !ruby/struct:VCR::Request
|
|
590
|
-
method: :delete
|
|
591
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/XZ0sHLGWuTFoIjwNFa1eWw00
|
|
592
|
-
body: !!null
|
|
593
|
-
headers:
|
|
594
|
-
accept:
|
|
595
|
-
- application/json
|
|
596
|
-
authorization:
|
|
597
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
598
|
-
response: !ruby/struct:VCR::Response
|
|
599
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
600
|
-
code: 204
|
|
601
|
-
message: No Content
|
|
602
|
-
headers:
|
|
603
|
-
server:
|
|
604
|
-
- Apache-Coyote/1.1
|
|
605
|
-
x-embedded-crowd-version:
|
|
606
|
-
- Crowd/2.3.3
|
|
607
|
-
x-crowd-user-management-version:
|
|
608
|
-
- '1.1'
|
|
609
|
-
set-cookie:
|
|
610
|
-
- JSESSIONID=7668AD93346DA50BC804F80498E70891; Path=/crowd
|
|
611
|
-
date:
|
|
612
|
-
- Mon, 24 Oct 2011 17:51:35 GMT
|
|
613
|
-
body: !!null
|
|
614
|
-
http_version: '1.1'
|
|
615
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
616
|
-
request: !ruby/struct:VCR::Request
|
|
617
|
-
method: :post
|
|
618
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/XZ0sHLGWuTFoIjwNFa1eWw00
|
|
619
|
-
body: ! '{}'
|
|
620
|
-
headers:
|
|
621
|
-
accept:
|
|
622
|
-
- application/json
|
|
623
|
-
authorization:
|
|
624
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
625
|
-
content-type:
|
|
626
|
-
- application/json
|
|
627
|
-
response: !ruby/struct:VCR::Response
|
|
628
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
629
|
-
code: 404
|
|
630
|
-
message: Not Found
|
|
631
|
-
headers:
|
|
632
|
-
server:
|
|
633
|
-
- Apache-Coyote/1.1
|
|
634
|
-
x-embedded-crowd-version:
|
|
635
|
-
- Crowd/2.3.3
|
|
636
|
-
x-crowd-user-management-version:
|
|
637
|
-
- '1.1'
|
|
638
|
-
set-cookie:
|
|
639
|
-
- JSESSIONID=32F4E96FE6D897D0D98BE42890CC6770; Path=/crowd
|
|
640
|
-
content-type:
|
|
641
|
-
- application/json
|
|
642
|
-
transfer-encoding:
|
|
643
|
-
- chunked
|
|
644
|
-
date:
|
|
645
|
-
- Mon, 24 Oct 2011 17:51:35 GMT
|
|
646
|
-
body: ! '{"reason":"INVALID_SSO_TOKEN","message":"Token does not validate."}'
|
|
647
|
-
http_version: '1.1'
|
|
648
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
649
|
-
request: !ruby/struct:VCR::Request
|
|
650
|
-
method: :post
|
|
651
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
|
|
652
|
-
body: ! '{"username":"user@example.com","password":"wrong_password"}'
|
|
653
|
-
headers:
|
|
654
|
-
accept:
|
|
655
|
-
- application/json
|
|
656
|
-
authorization:
|
|
657
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
658
|
-
content-type:
|
|
659
|
-
- application/json
|
|
660
|
-
response: !ruby/struct:VCR::Response
|
|
661
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
662
|
-
code: 400
|
|
663
|
-
message: Bad Request
|
|
664
|
-
headers:
|
|
665
|
-
server:
|
|
666
|
-
- Apache-Coyote/1.1
|
|
667
|
-
x-embedded-crowd-version:
|
|
668
|
-
- Crowd/2.3.3
|
|
669
|
-
x-crowd-user-management-version:
|
|
670
|
-
- '1.1'
|
|
671
|
-
set-cookie:
|
|
672
|
-
- JSESSIONID=8377CD6C163BF4054E8B7BAE067A2C54; Path=/crowd
|
|
673
|
-
content-type:
|
|
674
|
-
- application/json
|
|
675
|
-
transfer-encoding:
|
|
676
|
-
- chunked
|
|
677
|
-
date:
|
|
678
|
-
- Mon, 24 Oct 2011 17:51:58 GMT
|
|
679
|
-
body: ! '{"reason":"INVALID_USER_AUTHENTICATION","message":"Failed to authenticate
|
|
680
|
-
principal, password was invalid"}'
|
|
681
|
-
http_version: '1.1'
|
|
682
|
-
- !ruby/struct:VCR::HTTPInteraction
|
|
683
|
-
request: !ruby/struct:VCR::Request
|
|
684
|
-
method: :post
|
|
685
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session
|
|
686
|
-
body: ! '{"username":"inactive_user@example.com","password":"password"}'
|
|
687
|
-
headers:
|
|
688
|
-
accept:
|
|
689
|
-
- application/json
|
|
690
|
-
authorization:
|
|
691
|
-
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
692
|
-
content-type:
|
|
693
|
-
- application/json
|
|
694
|
-
response: !ruby/struct:VCR::Response
|
|
695
|
-
status: !ruby/struct:VCR::ResponseStatus
|
|
696
|
-
code: 400
|
|
697
|
-
message: Bad Request
|
|
698
|
-
headers:
|
|
699
|
-
server:
|
|
700
|
-
- Apache-Coyote/1.1
|
|
701
|
-
x-embedded-crowd-version:
|
|
702
|
-
- Crowd/2.3.3
|
|
703
|
-
x-crowd-user-management-version:
|
|
704
|
-
- '1.1'
|
|
705
|
-
set-cookie:
|
|
706
|
-
- JSESSIONID=74CD3F4173D9E523E64C021D4DB2F02F; Path=/crowd
|
|
155
|
+
- JSESSIONID=157F91CED1028584293EF2E88508B6AC; Path=/crowd
|
|
707
156
|
content-type:
|
|
708
157
|
- application/json
|
|
709
158
|
transfer-encoding:
|
|
710
159
|
- chunked
|
|
711
160
|
date:
|
|
712
|
-
- Mon, 24 Oct 2011
|
|
713
|
-
body: ! '{"
|
|
714
|
-
|
|
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"}}'
|
|
715
164
|
http_version: '1.1'
|
|
716
165
|
- !ruby/struct:VCR::HTTPInteraction
|
|
717
166
|
request: !ruby/struct:VCR::Request
|
|
718
167
|
method: :get
|
|
719
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?
|
|
168
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?username=user@example.com
|
|
720
169
|
body: !!null
|
|
721
170
|
headers:
|
|
722
171
|
accept:
|
|
@@ -735,19 +184,19 @@
|
|
|
735
184
|
x-crowd-user-management-version:
|
|
736
185
|
- '1.1'
|
|
737
186
|
set-cookie:
|
|
738
|
-
- JSESSIONID=
|
|
187
|
+
- JSESSIONID=1D4201195A8CDA7F90F1AF4CA6442A53; Path=/crowd
|
|
739
188
|
content-type:
|
|
740
189
|
- application/json
|
|
741
190
|
transfer-encoding:
|
|
742
191
|
- chunked
|
|
743
192
|
date:
|
|
744
|
-
- Mon, 24 Oct 2011
|
|
745
|
-
body: ! '{"link":{"href":"http://127.0.0.1:8095/crowd/rest/usermanagement/1/group?groupname=MyGroup","rel":"self"},"name":"MyGroup"}'
|
|
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"}]}'
|
|
746
195
|
http_version: '1.1'
|
|
747
196
|
- !ruby/struct:VCR::HTTPInteraction
|
|
748
197
|
request: !ruby/struct:VCR::Request
|
|
749
198
|
method: :get
|
|
750
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?
|
|
199
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user/group/nested?username=user@example.com
|
|
751
200
|
body: !!null
|
|
752
201
|
headers:
|
|
753
202
|
accept:
|
|
@@ -756,8 +205,8 @@
|
|
|
756
205
|
- Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
|
|
757
206
|
response: !ruby/struct:VCR::Response
|
|
758
207
|
status: !ruby/struct:VCR::ResponseStatus
|
|
759
|
-
code:
|
|
760
|
-
message:
|
|
208
|
+
code: 200
|
|
209
|
+
message: OK
|
|
761
210
|
headers:
|
|
762
211
|
server:
|
|
763
212
|
- Apache-Coyote/1.1
|
|
@@ -766,15 +215,14 @@
|
|
|
766
215
|
x-crowd-user-management-version:
|
|
767
216
|
- '1.1'
|
|
768
217
|
set-cookie:
|
|
769
|
-
- JSESSIONID=
|
|
218
|
+
- JSESSIONID=D475E1A06E78071C5AB66C48FCEBA727; Path=/crowd
|
|
770
219
|
content-type:
|
|
771
220
|
- application/json
|
|
772
221
|
transfer-encoding:
|
|
773
222
|
- chunked
|
|
774
223
|
date:
|
|
775
|
-
- Mon, 24 Oct 2011
|
|
776
|
-
body: ! '{"
|
|
777
|
-
is not a member of the parent <OtherGroup>"}'
|
|
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"}]}'
|
|
778
226
|
http_version: '1.1'
|
|
779
227
|
- !ruby/struct:VCR::HTTPInteraction
|
|
780
228
|
request: !ruby/struct:VCR::Request
|
|
@@ -800,23 +248,23 @@
|
|
|
800
248
|
x-crowd-user-management-version:
|
|
801
249
|
- '1.1'
|
|
802
250
|
set-cookie:
|
|
803
|
-
- JSESSIONID=
|
|
251
|
+
- JSESSIONID=DE53C317530856E2808D9A877345941A; Path=/crowd
|
|
804
252
|
cache-control:
|
|
805
253
|
- no-cache, no-store, no-transform
|
|
806
254
|
location:
|
|
807
|
-
- http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/
|
|
255
|
+
- http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
|
|
808
256
|
content-type:
|
|
809
257
|
- application/json
|
|
810
258
|
transfer-encoding:
|
|
811
259
|
- chunked
|
|
812
260
|
date:
|
|
813
|
-
- Mon, 24 Oct 2011
|
|
814
|
-
body: ! '{"expand":"user","token":"
|
|
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"}}'
|
|
815
263
|
http_version: '1.1'
|
|
816
264
|
- !ruby/struct:VCR::HTTPInteraction
|
|
817
265
|
request: !ruby/struct:VCR::Request
|
|
818
266
|
method: :post
|
|
819
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/
|
|
267
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
|
|
820
268
|
body: ! '{}'
|
|
821
269
|
headers:
|
|
822
270
|
accept:
|
|
@@ -837,7 +285,7 @@
|
|
|
837
285
|
x-crowd-user-management-version:
|
|
838
286
|
- '1.1'
|
|
839
287
|
set-cookie:
|
|
840
|
-
- JSESSIONID=
|
|
288
|
+
- JSESSIONID=8DE379BB9A6B565E8A85E42830D2C2CF; Path=/crowd
|
|
841
289
|
cache-control:
|
|
842
290
|
- no-cache, no-store, no-transform
|
|
843
291
|
content-type:
|
|
@@ -845,13 +293,13 @@
|
|
|
845
293
|
transfer-encoding:
|
|
846
294
|
- chunked
|
|
847
295
|
date:
|
|
848
|
-
- Mon, 24 Oct 2011
|
|
849
|
-
body: ! '{"expand":"user","token":"
|
|
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"}}'
|
|
850
298
|
http_version: '1.1'
|
|
851
299
|
- !ruby/struct:VCR::HTTPInteraction
|
|
852
300
|
request: !ruby/struct:VCR::Request
|
|
853
301
|
method: :delete
|
|
854
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/
|
|
302
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
|
|
855
303
|
body: !!null
|
|
856
304
|
headers:
|
|
857
305
|
accept:
|
|
@@ -870,15 +318,15 @@
|
|
|
870
318
|
x-crowd-user-management-version:
|
|
871
319
|
- '1.1'
|
|
872
320
|
set-cookie:
|
|
873
|
-
- JSESSIONID=
|
|
321
|
+
- JSESSIONID=4D3AE20269AFC73F3A063B8C3A47CF83; Path=/crowd
|
|
874
322
|
date:
|
|
875
|
-
- Mon, 24 Oct 2011
|
|
323
|
+
- Mon, 24 Oct 2011 18:58:18 GMT
|
|
876
324
|
body: !!null
|
|
877
325
|
http_version: '1.1'
|
|
878
326
|
- !ruby/struct:VCR::HTTPInteraction
|
|
879
327
|
request: !ruby/struct:VCR::Request
|
|
880
328
|
method: :post
|
|
881
|
-
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/
|
|
329
|
+
uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/session/HRz7gjbhx0vl6QnYRHKDjQ00
|
|
882
330
|
body: ! '{}'
|
|
883
331
|
headers:
|
|
884
332
|
accept:
|
|
@@ -899,12 +347,12 @@
|
|
|
899
347
|
x-crowd-user-management-version:
|
|
900
348
|
- '1.1'
|
|
901
349
|
set-cookie:
|
|
902
|
-
- JSESSIONID=
|
|
350
|
+
- JSESSIONID=8F33832C59536DAB7933396D8D953BC5; Path=/crowd
|
|
903
351
|
content-type:
|
|
904
352
|
- application/json
|
|
905
353
|
transfer-encoding:
|
|
906
354
|
- chunked
|
|
907
355
|
date:
|
|
908
|
-
- Mon, 24 Oct 2011
|
|
356
|
+
- Mon, 24 Oct 2011 18:58:18 GMT
|
|
909
357
|
body: ! '{"reason":"INVALID_SSO_TOKEN","message":"Token does not validate."}'
|
|
910
358
|
http_version: '1.1'
|
data/spec/crowd-client_spec.rb
CHANGED
|
@@ -45,6 +45,21 @@ describe Crowd::Client do
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
describe "#user(token)" do
|
|
49
|
+
|
|
50
|
+
it "should return the expanded user" do
|
|
51
|
+
token = subject.login('user@example.com', 'password')
|
|
52
|
+
subject.user(token)['name'].should == 'user@example.com'
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
describe "#user_groups(username)" do
|
|
57
|
+
it "should return the groups of the user" do
|
|
58
|
+
subject.user_groups('user@example.com').should include('MyGroup')
|
|
59
|
+
subject.user_groups('user@example.com').should_not include('OtherGroup')
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
48
63
|
describe "#logout" do
|
|
49
64
|
|
|
50
65
|
it "should logout the current session" do
|
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.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -13,7 +13,7 @@ date: 2011-10-24 00:00:00.000000000Z
|
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rspec
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &70149987425520 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ! '>='
|
|
@@ -21,10 +21,10 @@ dependencies:
|
|
|
21
21
|
version: '0'
|
|
22
22
|
type: :development
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *70149987425520
|
|
25
25
|
- !ruby/object:Gem::Dependency
|
|
26
26
|
name: vcr
|
|
27
|
-
requirement: &
|
|
27
|
+
requirement: &70149987424800 !ruby/object:Gem::Requirement
|
|
28
28
|
none: false
|
|
29
29
|
requirements:
|
|
30
30
|
- - ! '>='
|
|
@@ -32,10 +32,10 @@ dependencies:
|
|
|
32
32
|
version: '0'
|
|
33
33
|
type: :development
|
|
34
34
|
prerelease: false
|
|
35
|
-
version_requirements: *
|
|
35
|
+
version_requirements: *70149987424800
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: webmock
|
|
38
|
-
requirement: &
|
|
38
|
+
requirement: &70149987424100 !ruby/object:Gem::Requirement
|
|
39
39
|
none: false
|
|
40
40
|
requirements:
|
|
41
41
|
- - ! '>='
|
|
@@ -43,10 +43,10 @@ dependencies:
|
|
|
43
43
|
version: '0'
|
|
44
44
|
type: :development
|
|
45
45
|
prerelease: false
|
|
46
|
-
version_requirements: *
|
|
46
|
+
version_requirements: *70149987424100
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: faraday
|
|
49
|
-
requirement: &
|
|
49
|
+
requirement: &70149987423020 !ruby/object:Gem::Requirement
|
|
50
50
|
none: false
|
|
51
51
|
requirements:
|
|
52
52
|
- - ~>
|
|
@@ -54,10 +54,10 @@ dependencies:
|
|
|
54
54
|
version: 0.7.5
|
|
55
55
|
type: :runtime
|
|
56
56
|
prerelease: false
|
|
57
|
-
version_requirements: *
|
|
57
|
+
version_requirements: *70149987423020
|
|
58
58
|
- !ruby/object:Gem::Dependency
|
|
59
59
|
name: faraday_middleware
|
|
60
|
-
requirement: &
|
|
60
|
+
requirement: &70149987422240 !ruby/object:Gem::Requirement
|
|
61
61
|
none: false
|
|
62
62
|
requirements:
|
|
63
63
|
- - ~>
|
|
@@ -65,10 +65,10 @@ dependencies:
|
|
|
65
65
|
version: 0.7.0
|
|
66
66
|
type: :runtime
|
|
67
67
|
prerelease: false
|
|
68
|
-
version_requirements: *
|
|
68
|
+
version_requirements: *70149987422240
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: patron
|
|
71
|
-
requirement: &
|
|
71
|
+
requirement: &70149987421180 !ruby/object:Gem::Requirement
|
|
72
72
|
none: false
|
|
73
73
|
requirements:
|
|
74
74
|
- - ~>
|
|
@@ -76,10 +76,10 @@ dependencies:
|
|
|
76
76
|
version: 0.4.16
|
|
77
77
|
type: :runtime
|
|
78
78
|
prerelease: false
|
|
79
|
-
version_requirements: *
|
|
79
|
+
version_requirements: *70149987421180
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
|
81
81
|
name: json
|
|
82
|
-
requirement: &
|
|
82
|
+
requirement: &70149987416800 !ruby/object:Gem::Requirement
|
|
83
83
|
none: false
|
|
84
84
|
requirements:
|
|
85
85
|
- - ~>
|
|
@@ -87,7 +87,7 @@ dependencies:
|
|
|
87
87
|
version: 1.6.1
|
|
88
88
|
type: :runtime
|
|
89
89
|
prerelease: false
|
|
90
|
-
version_requirements: *
|
|
90
|
+
version_requirements: *70149987416800
|
|
91
91
|
description: A simple rest client for Crowd
|
|
92
92
|
email:
|
|
93
93
|
- paul@webpowerdesign.net
|
|
@@ -96,6 +96,7 @@ extensions: []
|
|
|
96
96
|
extra_rdoc_files: []
|
|
97
97
|
files:
|
|
98
98
|
- .gitignore
|
|
99
|
+
- .rvmrc
|
|
99
100
|
- Gemfile
|
|
100
101
|
- Rakefile
|
|
101
102
|
- crowd-client.gemspec
|