omniauth_crowd 2.1.3 → 2.2.0

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth_crowd (2.1.3)
4
+ omniauth_crowd (2.2.0)
5
5
  nokogiri (>= 1.4.4)
6
6
  omniauth (~> 1.0)
7
7
 
@@ -44,7 +44,7 @@ module OmniAuth
44
44
  def auth_hash
45
45
  OmniAuth::Utils.deep_merge(super, {
46
46
  'uid' => @user_info.delete("user"),
47
- 'user_info' => @user_info
47
+ 'info' => @user_info
48
48
  })
49
49
  end
50
50
  end
@@ -84,7 +84,6 @@ BODY
84
84
  req = http_method.new(uri.query.nil? ? uri.path : "#{uri.path}?#{uri.query}")
85
85
  req.body = body if body
86
86
  req.basic_auth @configuration.crowd_application_name, @configuration.crowd_password
87
- req.add_field 'Content-Type', 'text/xml'
88
87
  http.request(req)
89
88
  end
90
89
  end
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Crowd
3
- VERSION = "2.1.3"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
@@ -97,8 +97,13 @@ BODY
97
97
  before do
98
98
  stub_request(:post, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/authentication?username=foo").
99
99
  to_return(:body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'success.xml')))
100
+
100
101
  stub_request(:get, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").
101
- to_return(:body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'groups.xml')))
102
+ to_return(:body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'groups.xml')))
103
+
104
+ #Adding this to prevent Content-Type text/xml from being added back in the future
105
+ stub_request(:get, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").with(:headers => {"Content-Type" => "text/xml"}).
106
+ to_return(:status => [415, "Unsupported Media Type"])
102
107
  get '/auth/crowd/callback', nil, 'rack.session'=>{'omniauth.crowd'=> {"username"=>"foo", "password"=>"ba"}}
103
108
  end
104
109
  it 'should call through to the master app' do
@@ -109,10 +114,11 @@ BODY
109
114
  auth.should be_kind_of(Hash)
110
115
  end
111
116
  it 'should have good data' do
112
- auth = last_request.env['omniauth.auth']['provider'].should == :crowd
113
- auth = last_request.env['omniauth.auth']['uid'].should == 'foo'
114
- auth = last_request.env['omniauth.auth']['user_info'].should be_kind_of(Hash)
115
- auth = last_request.env['omniauth.auth']['user_info']['groups'].sort.should == ["Developers", "jira-users"].sort
117
+ auth = last_request.env['omniauth.auth']
118
+ auth['provider'].should == :crowd
119
+ auth['uid'].should == 'foo'
120
+ auth['info'].should be_kind_of(Hash)
121
+ auth['info']['groups'].sort.should == ["Developers", "jira-users"].sort
116
122
  end
117
123
  end
118
124
 
@@ -142,11 +148,12 @@ BODY
142
148
  end
143
149
 
144
150
  it 'should have good data' do
145
- auth = last_request.env['omniauth.auth']['provider'].should == :crowd
146
- auth = last_request.env['omniauth.auth']['uid'].should == 'foo'
147
- auth = last_request.env['omniauth.auth']['user_info'].should be_kind_of(Hash)
148
- auth = last_request.env['omniauth.auth']['user_info']['sso_token'].should == 'rtk8eMvqq00EiGn5iJCMZQ00'
149
- auth = last_request.env['omniauth.auth']['user_info']['groups'].sort.should == ["Developers", "jira-users"].sort
151
+ auth = last_request.env['omniauth.auth']
152
+ auth['provider'].should == :crowd
153
+ auth['uid'].should == 'foo'
154
+ auth['info'].should be_kind_of(Hash)
155
+ auth['info']['sso_token'].should == 'rtk8eMvqq00EiGn5iJCMZQ00'
156
+ auth['info']['groups'].sort.should == ["Developers", "jira-users"].sort
150
157
  end
151
158
  end
152
159
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth_crowd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-18 00:00:00.000000000 Z
12
+ date: 2013-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -179,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  segments:
181
181
  - 0
182
- hash: -1757168840233326872
182
+ hash: 653115758424820992
183
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  none: false
185
185
  requirements:
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  segments:
190
190
  - 0
191
- hash: -1757168840233326872
191
+ hash: 653115758424820992
192
192
  requirements: []
193
193
  rubyforge_project:
194
194
  rubygems_version: 1.8.25