crowd-client 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/Gemfile +2 -0
  2. data/crowd-client.gemspec +2 -2
  3. data/lib/crowd-client.rb +5 -0
  4. data/lib/crowd-client/version.rb +1 -1
  5. data/spec/cassettes/Crowd_Client/_in_group_/should_confirm_users_are_in_groups.yml +47 -46
  6. data/spec/cassettes/Crowd_Client/_login/should_authenticate_and_return_a_session_token.yml +28 -28
  7. data/spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_AuthenticationFailed_if_authentication_fails.yml +27 -26
  8. data/spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_InactiveAccount_if_an_account_is_inactive.yml +27 -26
  9. data/spec/cassettes/Crowd_Client/_logout/should_logout_the_current_session.yml +98 -98
  10. data/spec/cassettes/Crowd_Client/_search/should_return_user.yml +38 -0
  11. data/spec/cassettes/Crowd_Client/_user_groups_username_/should_return_the_groups_of_the_user.yml +24 -24
  12. data/spec/cassettes/Crowd_Client/_user_token_/should_return_the_expanded_user.yml +52 -51
  13. data/spec/cassettes/Crowd_Client/_valid_session_/should_validate_the_current_session.yml +53 -53
  14. data/spec/cassettes/Crowd_Client_Group/_add_user/missing_group/should_raise_Exception_NotFound_for_missing_group.yml +70 -70
  15. data/spec/cassettes/Crowd_Client_Group/_add_user/should_add_the_user.yml +94 -94
  16. data/spec/cassettes/Crowd_Client_Group/_add_user/should_raise_Exception_NotFound_for_missing_user.yml +71 -71
  17. data/spec/cassettes/Crowd_Client_Group/_remove_user/should_remove_the_user.yml +114 -114
  18. data/spec/cassettes/Crowd_Client_Group/_users/should_return_all_of_the_users_in_the_group.yml +24 -24
  19. data/spec/cassettes/Crowd_Client_User/Creating_a_user/should_create_a_user_with_attributes.yml +70 -69
  20. data/spec/cassettes/Crowd_Client_User/Get_groups_for_user/should_be_in_the_group.yml +24 -24
  21. data/spec/cassettes/Crowd_Client_User/Update_user/should_update_user_properties.yml +92 -90
  22. data/spec/cassettes/Crowd_Client_User/_destroy/should_delete_the_user.yml +70 -69
  23. data/spec/cassettes/Crowd_Client_User/authenticate/should_return_false_if_the_password_is_invalid.yml +27 -26
  24. data/spec/cassettes/Crowd_Client_User/authenticate/should_return_true_if_the_password_is_valid.yml +26 -25
  25. data/spec/cassettes/Crowd_Client_User/change_password/should_allow_the_user_to_set_a_new_password.yml +92 -91
  26. data/spec/cassettes/Crowd_Client_User/display_name/.yml +25 -24
  27. data/spec/cassettes/Crowd_Client_User/email/.yml +25 -24
  28. data/spec/crowd-client_spec.rb +6 -0
  29. data/spec/spec_helper.rb +2 -1
  30. metadata +24 -22
@@ -1,36 +1,37 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: get
5
5
  uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user?username=user@example.com
6
- body: ""
7
- headers:
8
- Accept:
6
+ body: ''
7
+ headers:
8
+ Accept:
9
9
  - application/json
10
- Authorization:
10
+ Authorization:
11
11
  - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
12
- Expect:
13
- - ""
14
- response:
15
- status:
12
+ Expect:
13
+ - ''
14
+ response:
15
+ status:
16
16
  code: 200
17
17
  message: OK
18
- headers:
19
- Server:
18
+ headers:
19
+ Server:
20
20
  - Apache-Coyote/1.1
21
- X-Embedded-Crowd-Version:
21
+ X-Embedded-Crowd-Version:
22
22
  - Crowd/2.3.3
23
- X-Crowd-User-Management-Version:
24
- - "1.1"
25
- Set-Cookie:
26
- - JSESSIONID=E100FB66EB0D519EF1C026C06A456369; Path=/crowd
27
- Content-Type:
23
+ X-Crowd-User-Management-Version:
24
+ - '1.1'
25
+ Set-Cookie:
26
+ - JSESSIONID=BE48C93C5D4F8AC5F6A42D6E150CF998; Path=/crowd
27
+ Content-Type:
28
28
  - application/json
29
- Transfer-Encoding:
29
+ Transfer-Encoding:
30
30
  - chunked
31
- Date:
32
- - Wed, 21 Dec 2011 20:57:01 GMT
33
- body: "{\"expand\":\"attributes\",\"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 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\"}}}"
31
+ Date:
32
+ - Tue, 15 Jan 2013 17:34:43 GMT
33
+ body: ! '{"expand":"attributes","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
34
+ 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"}}}'
34
35
  http_version:
35
- recorded_at: Wed, 21 Dec 2011 20:57:01 GMT
36
+ recorded_at: Tue, 15 Jan 2013 17:34:43 GMT
36
37
  recorded_with: VCR 2.0.0.rc1
@@ -1,36 +1,37 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: get
5
5
  uri: http://127.0.0.1:8095/crowd/rest/usermanagement/1/user?username=user@example.com
6
- body: ""
7
- headers:
8
- Accept:
6
+ body: ''
7
+ headers:
8
+ Accept:
9
9
  - application/json
10
- Authorization:
10
+ Authorization:
11
11
  - Basic YXBwbGljYXRpb246cGFzc3dvcmQ=
12
- Expect:
13
- - ""
14
- response:
15
- status:
12
+ Expect:
13
+ - ''
14
+ response:
15
+ status:
16
16
  code: 200
17
17
  message: OK
18
- headers:
19
- Server:
18
+ headers:
19
+ Server:
20
20
  - Apache-Coyote/1.1
21
- X-Embedded-Crowd-Version:
21
+ X-Embedded-Crowd-Version:
22
22
  - Crowd/2.3.3
23
- X-Crowd-User-Management-Version:
24
- - "1.1"
25
- Set-Cookie:
26
- - JSESSIONID=2148E801B32AE4684E8BFB8C8533CB90; Path=/crowd
27
- Content-Type:
23
+ X-Crowd-User-Management-Version:
24
+ - '1.1'
25
+ Set-Cookie:
26
+ - JSESSIONID=A2B0CCD8FEA7E2CF3C3EE988408E8DEA; Path=/crowd
27
+ Content-Type:
28
28
  - application/json
29
- Transfer-Encoding:
29
+ Transfer-Encoding:
30
30
  - chunked
31
- Date:
32
- - Wed, 21 Dec 2011 20:57:01 GMT
33
- body: "{\"expand\":\"attributes\",\"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 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\"}}}"
31
+ Date:
32
+ - Tue, 15 Jan 2013 17:34:43 GMT
33
+ body: ! '{"expand":"attributes","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
34
+ 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"}}}'
34
35
  http_version:
35
- recorded_at: Wed, 21 Dec 2011 20:57:01 GMT
36
+ recorded_at: Tue, 15 Jan 2013 17:34:44 GMT
36
37
  recorded_with: VCR 2.0.0.rc1
@@ -61,6 +61,12 @@ describe Crowd::Client do
61
61
  end
62
62
  end
63
63
 
64
+ describe "#search" do
65
+ it "should return user" do
66
+ subject.search("user@example.com").size.should == 1
67
+ end
68
+ end
69
+
64
70
  describe "#logout" do
65
71
  it "should logout the current session" do
66
72
  token = subject.login('user@example.com', 'password')
@@ -1,6 +1,7 @@
1
1
  # Requires supporting ruby files with custom matchers and macros, etc,
2
2
  # in spec/support/ and its subdirectories.
3
3
  require 'vcr'
4
+ require 'rspec'
4
5
  Dir[File.join(File.dirname(__FILE__), "spec/support/**/*.rb")].each {|f| require f}
5
6
 
6
7
  VCR.configure do |c|
@@ -18,7 +19,7 @@ RSpec.configure do |config|
18
19
  # config.mock_with :flexmock
19
20
  # config.mock_with :rr
20
21
  config.mock_with :rspec
21
- config.extend VCR::RSpec::Macros
22
+ # config.extend VCR::RSpec::Macros
22
23
 
23
24
  vcr_cassette_name_for = lambda do |metadata|
24
25
  description = metadata[:description]
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.1.5
4
+ version: 0.1.6
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: 2012-07-12 00:00:00.000000000 Z
12
+ date: 2013-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70196386518720 !ruby/object:Gem::Requirement
16
+ requirement: &70244492831600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,32 +21,32 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70196386518720
24
+ version_requirements: *70244492831600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: vcr
27
- requirement: &70196386518220 !ruby/object:Gem::Requirement
27
+ requirement: &70244492844020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
- - - ~>
30
+ - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0.rc1
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70196386518220
35
+ version_requirements: *70244492844020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: webmock
38
- requirement: &70196386517720 !ruby/object:Gem::Requirement
38
+ requirement: &70244492866600 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ~>
41
+ - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
43
  version: 1.7.8
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70196386517720
46
+ version_requirements: *70244492866600
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: ruby-debug19
49
- requirement: &70196386517340 !ruby/object:Gem::Requirement
49
+ requirement: &70244492884180 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70196386517340
57
+ version_requirements: *70244492884180
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: faraday
60
- requirement: &70196386516800 !ruby/object:Gem::Requirement
60
+ requirement: &70244492894260 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.7.5
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70196386516800
68
+ version_requirements: *70244492894260
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: faraday_middleware
71
- requirement: &70196386516300 !ruby/object:Gem::Requirement
71
+ requirement: &70244492906080 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.7.0
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70196386516300
79
+ version_requirements: *70244492906080
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: patron
82
- requirement: &70196386515840 !ruby/object:Gem::Requirement
82
+ requirement: &70244492917160 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 0.4.16
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70196386515840
90
+ version_requirements: *70244492917160
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: json
93
- requirement: &70196386515380 !ruby/object:Gem::Requirement
93
+ requirement: &70244492946500 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.6.1
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70196386515380
101
+ version_requirements: *70244492946500
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: activesupport
104
- requirement: &70196386514920 !ruby/object:Gem::Requirement
104
+ requirement: &70244492969320 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 3.1.0
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70196386514920
112
+ version_requirements: *70244492969320
113
113
  description: A simple rest client for Crowd
114
114
  email:
115
115
  - paul@webpowerdesign.net
@@ -133,6 +133,7 @@ files:
133
133
  - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_AuthenticationFailed_if_authentication_fails.yml
134
134
  - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_InactiveAccount_if_an_account_is_inactive.yml
135
135
  - spec/cassettes/Crowd_Client/_logout/should_logout_the_current_session.yml
136
+ - spec/cassettes/Crowd_Client/_search/should_return_user.yml
136
137
  - spec/cassettes/Crowd_Client/_user_groups_username_/should_return_the_groups_of_the_user.yml
137
138
  - spec/cassettes/Crowd_Client/_user_token_/should_return_the_expanded_user.yml
138
139
  - spec/cassettes/Crowd_Client/_valid_session_/should_validate_the_current_session.yml
@@ -184,6 +185,7 @@ test_files:
184
185
  - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_AuthenticationFailed_if_authentication_fails.yml
185
186
  - spec/cassettes/Crowd_Client/_login/should_raise_Crowd_Client_Exception_InactiveAccount_if_an_account_is_inactive.yml
186
187
  - spec/cassettes/Crowd_Client/_logout/should_logout_the_current_session.yml
188
+ - spec/cassettes/Crowd_Client/_search/should_return_user.yml
187
189
  - spec/cassettes/Crowd_Client/_user_groups_username_/should_return_the_groups_of_the_user.yml
188
190
  - spec/cassettes/Crowd_Client/_user_token_/should_return_the_expanded_user.yml
189
191
  - spec/cassettes/Crowd_Client/_valid_session_/should_validate_the_current_session.yml