socialcast 1.3.3 → 1.3.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWUzYmYzN2M5OGQ4MWI4OWEzMzhjYmExOGJkZjdhZjljM2ExM2Q2OQ==
4
+ NmI1ZDYyYjY1YjFlNjY3NzYyOTQ3YjdkMGZlYjAzMWU0ZWVlZGJhNg==
5
5
  data.tar.gz: !binary |-
6
- MmFiZGExOWY3ZWJiM2ZhNjRlMWRiMTcwMzQ2NWQ4MzNlOTc4NzI4Mw==
6
+ MDFhNzNhNGE4MTVmZjdhMGE0NGFiYTMyZjNjMzM4ZDBiNmM5NDUwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWYzYTY4YjZkZmE2Yzg1NjRiZDZhYjA2NzdlMzg2ZTNjOTMzZWU5NDY5NjYw
10
- ZWVmYWQ2OGE1NTc5ZTMzZjM0YjA1ZDRhMmMwYmU0NjIxZWI2ZmEzN2E5ZGQz
11
- MjFiYWMwMjU5MDExZDYxYWQzYmYxNjhjODkzMmVmODE2YWM0MzE=
9
+ ODBiZmIxOWQ4NjUxYWY0M2E5MGZhZjZjODJhYWQ1NzYzMmRhOGQzZjg1OTdh
10
+ ODc1ZjRjZDViZTBhZDAzMWM5YTljZjI4ZmFhZmI5NTAzNzg3ZDljMWJjMWY2
11
+ OGYzYTczYjIzYmJiZTNlMDI5ZWVkNGJlZmY0ZDEzYTQzNzJjYjU=
12
12
  data.tar.gz: !binary |-
13
- Y2QxNjdmMWJhMGYzYTk0MmFjNWI2MDIyODI2ZTIwOTE1YWQ5MWVkMTQ0ODM4
14
- MTJmMjU3NDY2YTMxMTNiNzY4MTM1NDliOTlkMWFlYTYwM2ExMDI2ZmIwMGRk
15
- NzIxMjI0N2YwNWQxMzU1MjQwNTVhZThkYzFlZjVhMzY0OTAyMWY=
13
+ OTc2M2U5YWFiYWY4MTVhZjI5NTllODAxYTEzZjc4ZjlhOWFiYTg0NDhjZWJk
14
+ Njg4OGRlNDJkMWI0NmE4NjE2NDc2ZjgxODIwZjFlYTJhMTEwMTQyNDYwM2Qz
15
+ ZGYzMmVhNTY1MDk5NmI5YzYzYjg0ZmFjMDAyOTk0ODQ1YmU0Y2Y=
@@ -78,7 +78,7 @@ module Socialcast
78
78
  end
79
79
 
80
80
  def attribute_mappings
81
- @attribute_mappings ||= connection_config.fetch 'mappings', nil
81
+ @attribute_mappings ||= connection_config['mappings']
82
82
  @attribute_mappings ||= @config.fetch 'mappings', {}
83
83
  end
84
84
 
@@ -140,13 +140,12 @@ module Socialcast
140
140
  end
141
141
 
142
142
  def permission_mappings
143
- @permission_mappings ||= connection_config.fetch 'permission_mappings', nil
143
+ @permission_mappings ||= connection_config['permission_mappings']
144
144
  @permission_mappings ||= @config.fetch 'permission_mappings', {}
145
145
  end
146
146
 
147
147
  def group_membership_mappings
148
- @group_membership_mappings ||= connection_config.fetch 'group_membership_mappings', nil
149
- @group_membership_mappings ||= @config.fetch 'group_membership_mappings', {}
148
+ permission_mappings['group_memberships']
150
149
  end
151
150
 
152
151
  def dereference_mail(entry, dn_field, mail_attribute)
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module CommandLine
3
- VERSION = "1.3.3"
3
+ VERSION = "1.3.4"
4
4
  end
5
5
  end
@@ -32,17 +32,17 @@ describe Socialcast::CommandLine::LDAPConnector do
32
32
  "sbi_admin" => "cn=SbiAdmins,dc=example,dc=com",
33
33
  "reach_admin" => "cn=ReachAdmins,dc=example,dc=com",
34
34
  "town_hall_admin" => "cn=TownHallAdmins,dc=example,dc=com"
35
- }
35
+ },
36
+ "group_memberships" => group_membership_mappings
36
37
  }
37
38
  end
38
- let(:group_membership_mappings) { "" }
39
+ let(:group_membership_mappings) { nil }
39
40
 
40
41
  let(:ldap_config) do
41
42
  {
42
43
  "connections" => connections,
43
44
  "mappings" => mappings,
44
45
  "permission_mappings" => permission_mappings,
45
- "group_membership_mappings" => group_membership_mappings
46
46
  }
47
47
  end
48
48
 
@@ -237,61 +237,6 @@ describe Socialcast::CommandLine::LDAPConnector do
237
237
  }))
238
238
  end
239
239
  end
240
- context "with socialcast group ldap group membership mappings at the connection level" do
241
- let(:group_membership_mappings) do
242
- {
243
- "filter" => "(objectClass=groupOfUniqueNames)",
244
- "unique_identifier" => "gid"
245
- }
246
- end
247
- let(:connector) { Socialcast::CommandLine::LDAPConnector.new('connection_1', ldap_config) }
248
- let(:group_entry) do
249
- create_entry(:dn => "cn=Sales,dc=example,dc=com", :groupId => "sales_group_id")
250
- end
251
- let(:user_entry) do
252
- create_entry(:mail => 'user@example.com',
253
- :givenName => 'first name',
254
- :sn => 'last name',
255
- :isMemberOf => ["cn=SFOffice,dc=example,dc=com", "cn=Sales,dc=example,dc=com"])
256
- end
257
- before do
258
- connection.merge!({
259
- "group_membership_mappings" => {
260
- "filter" => "(groupId=*)",
261
- "unique_identifier" => "groupId"
262
- }
263
- })
264
- ldap_instance = double(Net::LDAP, :auth => nil)
265
- Net::LDAP.should_receive(:new).once.and_return(ldap_instance)
266
-
267
- ldap_instance.should_receive(:search).once.ordered.with(
268
- :return_result => false,
269
- :filter => "(mail=*)",
270
- :base => "dc=example,dc=com",
271
- :attributes => ['givenName', 'sn', 'mail', 'isMemberOf']).and_yield(user_entry)
272
-
273
- ldap_instance.should_receive(:search).once.ordered.with(
274
- :return_result => false,
275
- :filter => "(groupId=*)",
276
- :base => "dc=example,dc=com",
277
- :attributes => ["groupId"]).and_yield(group_entry)
278
- end
279
- it "includes group memberships" do
280
- expect do |blk|
281
- connector.each_user_hash(&blk)
282
- end.to yield_with_args(HashWithIndifferentAccess.new({
283
- 'first_name' => 'first name',
284
- 'last_name' => 'last name',
285
- 'contact_info' => {
286
- 'email' => 'user@example.com',
287
- },
288
- 'custom_fields' => [],
289
- 'account_type' => 'member',
290
- 'roles' => [],
291
- 'groups' => ['sales_group_id']
292
- }))
293
- end
294
- end
295
240
  end
296
241
 
297
242
  describe "#each_ldap_entry" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-24 00:00:00.000000000 Z
13
+ date: 2014-04-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client