ldap_groups_lookup 0.9.0 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87571e7afbf4949aab968013b93e8aef388659e5196346d1b1d70cf9bdfa34ed
4
- data.tar.gz: 4ffba8461216819da410a872d463fe8a49e73495c8f7d4ca3e96aeff6e81123d
3
+ metadata.gz: 4d6da72dceefbf3ea333aeb46b7288da0d3ec3517c05fbcbc77f53eb3fc955f2
4
+ data.tar.gz: 1720d92a5e416dbb2f4fafec7c2fc85239d82bb8ef6982909646217260d91457
5
5
  SHA512:
6
- metadata.gz: '009ec292b50df3a270bca37bdf49ce1dfa3cc82c21dd0efb9764743489d5ec16cf983af3446019aed0a58923d174abb0e2e8af2122a583b11e633ba210d37cfe'
7
- data.tar.gz: 9ac84ea34432eb8430793031d9a4f45e34eb06cba597e59d0f8c7978af13608cdb25fe91d4e99fc236cbeddb42ea2f03b95a0166359d0a9f3fec1012aaba5471
6
+ metadata.gz: b05d74e63567fb0e0272cf2242a395c9a0dc0125306112e1671eba47bd9460c73c1fff154d1b5708fc4669f0877d9d30dd87320256fcbdf7f39ca56269d8d9cc
7
+ data.tar.gz: 5becbdb0a9356bfa9b53df4133d9ffc955b77a0c50757265d80457ee7a0c86b59d74cca811732fefbb8700879d1210de3cd120c50095bd81cc4fb464f686f468
@@ -4,6 +4,7 @@ require 'erb'
4
4
  # Provides access to the configuration YAML file.
5
5
  module LDAPGroupsLookup
6
6
  module Configuration
7
+ attr_writer :config
7
8
 
8
9
  # Attempts to create a connection to LDAP and returns a cached Net::LDAP instance if successful.
9
10
  def service
@@ -1,5 +1,5 @@
1
1
  # Gem version release tracking
2
2
  module LDAPGroupsLookup
3
3
  # Define release version
4
- VERSION = '0.9.0'.freeze
4
+ VERSION = '0.10.0'.freeze
5
5
  end
@@ -13,254 +13,263 @@ RSpec.describe LDAPGroupsLookup do
13
13
  end
14
14
  let(:user) { user_class.new }
15
15
 
16
- # Load the example config from fixtures
17
- let(:config) { YAML.load(ERB.new(File.read(File.join(File.dirname(__dir__), 'fixtures', 'ldap_groups_lookup.yml.example'))).result) }
18
-
19
- before do
20
- allow(LDAPGroupsLookup).to receive(:config).and_return(config)
21
- end
22
-
23
16
  after do
24
17
  LDAPGroupsLookup.reset
25
18
  end
26
19
 
27
- describe '#service' do
28
- context 'when the config file is missing' do
29
- before do
30
- allow(LDAPGroupsLookup).to receive(:config).and_call_original
31
- expect(File).to receive(:exist?).with(/config\/ldap_groups_lookup\.yml$/)
32
- end
33
- it 'should return nil' do
34
- expect(LDAPGroupsLookup.service).to be_nil
35
- end
20
+ describe '#config' do
21
+ it 'sets the config directly' do
22
+ LDAPGroupsLookup.config = { direct_config: 'works' }
23
+ expect(LDAPGroupsLookup.config).to eq({ direct_config: 'works' })
36
24
  end
37
- context 'when disabled in the configuration file' do
38
- before do
39
- config[:enabled] = false
40
- end
41
- it 'should return nil' do
42
- expect(LDAPGroupsLookup.service).to be_nil
43
- end
25
+ end
26
+
27
+ context 'with a config file' do
28
+ # Load the example config from fixtures
29
+ let(:config) { YAML.load(ERB.new(File.read(File.join(File.dirname(__dir__), 'fixtures', 'ldap_groups_lookup.yml.example'))).result) }
30
+
31
+ before do
32
+ allow(LDAPGroupsLookup).to receive(:config).and_return(config)
44
33
  end
45
- context 'when enabled in the configuration file' do
46
- it 'should be enabled' do
47
- expect(config[:enabled]).to eq(true)
48
- end
49
- context 'when the auth credentials are incorrect' do
34
+
35
+ describe '#service' do
36
+ context 'when the config file is missing' do
50
37
  before do
51
- allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(false)
38
+ allow(LDAPGroupsLookup).to receive(:config).and_call_original
39
+ expect(File).to receive(:exist?).with(/config\/ldap_groups_lookup\.yml$/)
52
40
  end
53
- it 'should raise an LdapError' do
54
- expect { LDAPGroupsLookup.service }.to raise_error(Net::LDAP::Error)
41
+ it 'should return nil' do
42
+ expect(LDAPGroupsLookup.service).to be_nil
55
43
  end
56
44
  end
57
- context 'when the auth credentials are correct' do
45
+ context 'when disabled in the configuration file' do
58
46
  before do
59
- allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(true)
47
+ config[:enabled] = false
60
48
  end
61
- it 'should return a Net::LDAP instance' do
62
- expect(LDAPGroupsLookup.service).to be_an_instance_of(Net::LDAP)
49
+ it 'should return nil' do
50
+ expect(LDAPGroupsLookup.service).to be_nil
63
51
  end
64
-
65
- context 'when the :config key is set' do
66
- let(:config_hash) { { host: 'localhost', port: 636, encryption: { method: :simple_tls, tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS } } }
67
- before { config[:config] = config_hash }
68
- it 'uses that config' do
69
- expect(Net::LDAP).to receive(:new).with(config_hash).and_call_original
52
+ end
53
+ context 'when enabled in the configuration file' do
54
+ it 'should be enabled' do
55
+ expect(config[:enabled]).to eq(true)
56
+ end
57
+ context 'when the auth credentials are incorrect' do
58
+ before do
59
+ allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(false)
60
+ end
61
+ it 'should raise an LdapError' do
62
+ expect { LDAPGroupsLookup.service }.to raise_error(Net::LDAP::Error)
63
+ end
64
+ end
65
+ context 'when the auth credentials are correct' do
66
+ before do
67
+ allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(true)
68
+ end
69
+ it 'should return a Net::LDAP instance' do
70
70
  expect(LDAPGroupsLookup.service).to be_an_instance_of(Net::LDAP)
71
71
  end
72
+
73
+ context 'when the :config key is set' do
74
+ let(:config_hash) { { host: 'localhost', port: 636, encryption: { method: :simple_tls, tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS } } }
75
+ before { config[:config] = config_hash }
76
+ it 'uses that config' do
77
+ expect(Net::LDAP).to receive(:new).with(config_hash).and_call_original
78
+ expect(LDAPGroupsLookup.service).to be_an_instance_of(Net::LDAP)
79
+ end
80
+ end
72
81
  end
73
82
  end
74
83
  end
75
- end
76
84
 
77
- describe '#ldap_mail' do
78
- before(:each) do
79
- entry = Net::LDAP::Entry.new('CN=user,DC=ads,DC=example,DC=net')
80
- entry['mail'] = ['user@domain.ext']
81
- allow_any_instance_of(Net::LDAP).to receive(:search).and_return([entry])
82
- allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(true)
83
- end
84
- context 'when subject does not provide ldap_lookup_key method' do
85
- before(:each) { user.class.send(:remove_method, :ldap_lookup_key) }
86
- it 'should return ''' do
87
- expect(user.ldap_mail).to eq('')
85
+ describe '#ldap_mail' do
86
+ before(:each) do
87
+ entry = Net::LDAP::Entry.new('CN=user,DC=ads,DC=example,DC=net')
88
+ entry['mail'] = ['user@domain.ext']
89
+ allow_any_instance_of(Net::LDAP).to receive(:search).and_return([entry])
90
+ allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(true)
88
91
  end
89
- end
90
- context 'when subject does not provide ldap_lookup_key value' do
91
- before(:each) { allow(user).to receive(:ldap_lookup_key).and_return(nil) }
92
- it 'should return ''' do
93
- expect(user.ldap_mail).to eq('')
94
- end
95
- end
96
- context 'when subject provides ldap_lookup_key' do
97
- context 'when LDAP is not configured' do
98
- before(:each) do
99
- config[:enabled] = false
92
+ context 'when subject does not provide ldap_lookup_key method' do
93
+ before(:each) { user.class.send(:remove_method, :ldap_lookup_key) }
94
+ it 'should return ''' do
95
+ expect(user.ldap_mail).to eq('')
100
96
  end
101
- it 'should return a blank string' do
97
+ end
98
+ context 'when subject does not provide ldap_lookup_key value' do
99
+ before(:each) { allow(user).to receive(:ldap_lookup_key).and_return(nil) }
100
+ it 'should return ''' do
102
101
  expect(user.ldap_mail).to eq('')
103
102
  end
104
103
  end
105
- context 'when LDAP is configured' do
106
- it 'user should should have a mail attribute in mock LDAP' do
107
- expect(user.ldap_mail).to eq 'user@domain.ext'
104
+ context 'when subject provides ldap_lookup_key' do
105
+ context 'when LDAP is not configured' do
106
+ before(:each) do
107
+ config[:enabled] = false
108
+ end
109
+ it 'should return a blank string' do
110
+ expect(user.ldap_mail).to eq('')
111
+ end
112
+ end
113
+ context 'when LDAP is configured' do
114
+ it 'user should should have a mail attribute in mock LDAP' do
115
+ expect(user.ldap_mail).to eq 'user@domain.ext'
116
+ end
108
117
  end
109
118
  end
110
119
  end
111
- end
112
120
 
113
- describe '#ldap_groups' do
114
- before(:each) do
115
- entry = Net::LDAP::Entry.new('CN=user,DC=ads,DC=example,DC=net')
116
- entry['memberof'] = ['CN=Group1,DC=ads,DC=example,DC=net',
117
- 'CN=Group2,DC=ads,DC=example,DC=net']
118
- allow_any_instance_of(Net::LDAP).to receive(:search).and_return([entry])
119
- allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(true)
120
- end
121
- context 'when subject does not provide ldap_lookup_key method' do
122
- before(:each) { user.class.send(:remove_method, :ldap_lookup_key) }
123
- it 'should return []' do
124
- expect(user.ldap_groups).to eq([])
125
- end
126
- end
127
- context 'when subject does not provide ldap_lookup_key value' do
128
- before(:each) { allow(user).to receive(:ldap_lookup_key).and_return(nil) }
129
- it 'should return []' do
130
- expect(user.ldap_groups).to eq([])
121
+ describe '#ldap_groups' do
122
+ before(:each) do
123
+ entry = Net::LDAP::Entry.new('CN=user,DC=ads,DC=example,DC=net')
124
+ entry['memberof'] = ['CN=Group1,DC=ads,DC=example,DC=net',
125
+ 'CN=Group2,DC=ads,DC=example,DC=net']
126
+ allow_any_instance_of(Net::LDAP).to receive(:search).and_return([entry])
127
+ allow_any_instance_of(Net::LDAP).to receive(:bind).and_return(true)
131
128
  end
132
- end
133
- context 'when subject provides ldap_lookup_key' do
134
- context 'when LDAP is not configured' do
135
- before(:each) do
136
- config[:enabled] = false
129
+ context 'when subject does not provide ldap_lookup_key method' do
130
+ before(:each) { user.class.send(:remove_method, :ldap_lookup_key) }
131
+ it 'should return []' do
132
+ expect(user.ldap_groups).to eq([])
137
133
  end
134
+ end
135
+ context 'when subject does not provide ldap_lookup_key value' do
136
+ before(:each) { allow(user).to receive(:ldap_lookup_key).and_return(nil) }
138
137
  it 'should return []' do
139
138
  expect(user.ldap_groups).to eq([])
140
139
  end
141
140
  end
142
- context 'when LDAP is configured' do
143
- it 'user should belong to Group1 and Group2 in mock LDAP' do
144
- expect(user.ldap_groups).to eq(%w(Group1 Group2))
141
+ context 'when subject provides ldap_lookup_key' do
142
+ context 'when LDAP is not configured' do
143
+ before(:each) do
144
+ config[:enabled] = false
145
+ end
146
+ it 'should return []' do
147
+ expect(user.ldap_groups).to eq([])
148
+ end
149
+ end
150
+ context 'when LDAP is configured' do
151
+ it 'user should belong to Group1 and Group2 in mock LDAP' do
152
+ expect(user.ldap_groups).to eq(%w(Group1 Group2))
153
+ end
145
154
  end
146
155
  end
147
156
  end
148
- end
149
157
 
150
- describe '#member_of_ldap_group?' do
151
- context 'when subject does not provide ldap_lookup_key method' do
152
- before(:each) { user.class.send(:remove_method, :ldap_lookup_key) }
153
- it 'should return false' do
154
- expect(user.member_of_ldap_group?('Test-Group')).to eq(false)
155
- end
156
- end
157
- context 'when subject does not provide ldap_lookup_key value' do
158
- before(:each) { allow(user).to receive(:ldap_lookup_key).and_return(nil) }
159
- it 'should return false' do
160
- expect(user.member_of_ldap_group?('Test-Group')).to eq(false)
161
- end
162
- end
163
- context 'when subject provides ldap_lookup_key' do
164
- context 'when LDAP is not configured' do
165
- before(:each) do
166
- config[:enabled] = false
158
+ describe '#member_of_ldap_group?' do
159
+ context 'when subject does not provide ldap_lookup_key method' do
160
+ before(:each) { user.class.send(:remove_method, :ldap_lookup_key) }
161
+ it 'should return false' do
162
+ expect(user.member_of_ldap_group?('Test-Group')).to eq(false)
167
163
  end
164
+ end
165
+ context 'when subject does not provide ldap_lookup_key value' do
166
+ before(:each) { allow(user).to receive(:ldap_lookup_key).and_return(nil) }
168
167
  it 'should return false' do
169
168
  expect(user.member_of_ldap_group?('Test-Group')).to eq(false)
170
169
  end
171
170
  end
172
- context 'when LDAP is configured' do
173
- before(:each) do
174
- @service = double('ldap_service')
175
- allow(LDAPGroupsLookup).to receive(:service).and_return(@service)
176
-
177
- allow(LDAPGroupsLookup).to receive(:lookup_dn) do |args|
178
- Net::LDAP::Entry.new("CN=#{args},DC=ads,DC=example,DC=net").dn
171
+ context 'when subject provides ldap_lookup_key' do
172
+ context 'when LDAP is not configured' do
173
+ before(:each) do
174
+ config[:enabled] = false
179
175
  end
176
+ it 'should return false' do
177
+ expect(user.member_of_ldap_group?('Test-Group')).to eq(false)
178
+ end
179
+ end
180
+ context 'when LDAP is configured' do
181
+ before(:each) do
182
+ @service = double('ldap_service')
183
+ allow(LDAPGroupsLookup).to receive(:service).and_return(@service)
180
184
 
181
- @other_group = Net::LDAP::Entry.new('CN=Other-Group,OU=Groups,DC=ads,DC=example,DC=net')
182
- @other_group['member;range=0-*'] = ['CN=otheruser,DC=ads,DC=example,DC=net']
185
+ allow(LDAPGroupsLookup).to receive(:lookup_dn) do |args|
186
+ Net::LDAP::Entry.new("CN=#{args},DC=ads,DC=example,DC=net").dn
187
+ end
183
188
 
184
- @nested_group_page_1 = Net::LDAP::Entry.new('CN=Nested-Group,OU=Groups,DC=ads,DC=example,DC=net')
185
- @nested_group_page_1['member;range=0-0'] = ['CN=otheruser,DC=ads,DC=example,DC=net']
189
+ @other_group = Net::LDAP::Entry.new('CN=Other-Group,OU=Groups,DC=ads,DC=example,DC=net')
190
+ @other_group['member;range=0-*'] = ['CN=otheruser,DC=ads,DC=example,DC=net']
186
191
 
187
- @nested_group_page_2 = Net::LDAP::Entry.new('CN=Nested-Group,OU=Groups,DC=ads,DC=example,DC=net')
188
- @nested_group_page_2['member;range=1-*'] = ['CN=user,DC=ads,DC=example,DC=net']
192
+ @nested_group_page_1 = Net::LDAP::Entry.new('CN=Nested-Group,OU=Groups,DC=ads,DC=example,DC=net')
193
+ @nested_group_page_1['member;range=0-0'] = ['CN=otheruser,DC=ads,DC=example,DC=net']
189
194
 
190
- @top_group = Net::LDAP::Entry.new('CN=Top-Group,OU=Groups,DC=ads,DC=example,DC=net')
191
- @top_group['member;range=0-*'] = ['CN=Nested-Group,OU=Groups,DC=ads,DC=example,DC=net']
195
+ @nested_group_page_2 = Net::LDAP::Entry.new('CN=Nested-Group,OU=Groups,DC=ads,DC=example,DC=net')
196
+ @nested_group_page_2['member;range=1-*'] = ['CN=user,DC=ads,DC=example,DC=net']
192
197
 
193
- @no_member_group = Net::LDAP::Entry.new('CN=No-Member-Group,OU=Groups,DC=ads,DC=example,DC=net')
194
- end
195
- context 'when searching for a group that does not exist' do
196
- it 'should return false' do
197
- expect(@service).to receive(:search).with(
198
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'Fake-Group'))).and_return([])
199
- expect(user.member_of_ldap_group?('Fake-Group')).to eq(false)
200
- end
201
- end
202
- context 'when searching for a group that user is not a member of' do
203
- it 'should return false' do
204
- expect(@service).to receive(:search).with(
205
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'Other-Group'))).and_return([@other_group])
206
- expect(user.member_of_ldap_group?('Other-Group')).to eq(false)
207
- end
208
- end
209
- context 'when searching for a group that has no members' do
210
- it 'should return false' do
211
- expect(@service).to receive(:search).with(
212
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'No-Member-Group'))).and_return([@no_member_group])
213
- expect(user.member_of_ldap_group?('No-Member-Group')).to eq(false)
198
+ @top_group = Net::LDAP::Entry.new('CN=Top-Group,OU=Groups,DC=ads,DC=example,DC=net')
199
+ @top_group['member;range=0-*'] = ['CN=Nested-Group,OU=Groups,DC=ads,DC=example,DC=net']
200
+
201
+ @no_member_group = Net::LDAP::Entry.new('CN=No-Member-Group,OU=Groups,DC=ads,DC=example,DC=net')
214
202
  end
215
- end
216
- context 'when searching for a group that user is a direct member of on the second page' do
217
- it 'should return true' do
218
- expect(@service).to receive(:search).with(
219
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
220
- attributes: ['member;range=0-*'])).and_return([@nested_group_page_1])
221
- expect(@service).to receive(:search).with(
222
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
223
- attributes: ['member;range=1-*'])).and_return([@nested_group_page_2])
224
- expect(user.member_of_ldap_group?('Nested-Group')).to eq(true)
203
+ context 'when searching for a group that does not exist' do
204
+ it 'should return false' do
205
+ expect(@service).to receive(:search).with(
206
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'Fake-Group'))).and_return([])
207
+ expect(user.member_of_ldap_group?('Fake-Group')).to eq(false)
208
+ end
225
209
  end
226
- end
227
- context 'when searching for a group that user is a nested member of' do
228
- before do
229
- expect(@service).to receive(:search).with(
230
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'Top-Group'))).and_return([@top_group])
231
- allow(@service).to receive(:search).with(
232
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
233
- attributes: ['member;range=0-*'])).and_return([@nested_group_page_1])
234
- allow(@service).to receive(:search).with(
235
- hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
236
- attributes: ['member;range=1-*'])).and_return([@nested_group_page_2])
210
+ context 'when searching for a group that user is not a member of' do
211
+ it 'should return false' do
212
+ expect(@service).to receive(:search).with(
213
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'Other-Group'))).and_return([@other_group])
214
+ expect(user.member_of_ldap_group?('Other-Group')).to eq(false)
215
+ end
237
216
  end
238
- context 'when the group is whitelisted' do
239
- before do
240
- allow(LDAPGroupsLookup).to receive(:member_whitelist).and_return(['OU=Groups'])
217
+ context 'when searching for a group that has no members' do
218
+ it 'should return false' do
219
+ expect(@service).to receive(:search).with(
220
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'No-Member-Group'))).and_return([@no_member_group])
221
+ expect(user.member_of_ldap_group?('No-Member-Group')).to eq(false)
241
222
  end
223
+ end
224
+ context 'when searching for a group that user is a direct member of on the second page' do
242
225
  it 'should return true' do
243
- expect(user.member_of_ldap_group?('Top-Group')).to eq(true)
226
+ expect(@service).to receive(:search).with(
227
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
228
+ attributes: ['member;range=0-*'])).and_return([@nested_group_page_1])
229
+ expect(@service).to receive(:search).with(
230
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
231
+ attributes: ['member;range=1-*'])).and_return([@nested_group_page_2])
232
+ expect(user.member_of_ldap_group?('Nested-Group')).to eq(true)
244
233
  end
245
234
  end
246
- context 'when the whitelist is empty' do
235
+ context 'when searching for a group that user is a nested member of' do
247
236
  before do
248
- allow(LDAPGroupsLookup).to receive(:member_whitelist).and_return([])
237
+ expect(@service).to receive(:search).with(
238
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'Top-Group'))).and_return([@top_group])
239
+ allow(@service).to receive(:search).with(
240
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
241
+ attributes: ['member;range=0-*'])).and_return([@nested_group_page_1])
242
+ allow(@service).to receive(:search).with(
243
+ hash_including(filter: Net::LDAP::Filter.equals('cn', 'Nested-Group'),
244
+ attributes: ['member;range=1-*'])).and_return([@nested_group_page_2])
249
245
  end
250
- it 'should return true (whitelisting is disabled)' do
251
- expect(user.member_of_ldap_group?('Top-Group')).to eq(true)
246
+ context 'when the group is whitelisted' do
247
+ before do
248
+ allow(LDAPGroupsLookup).to receive(:member_whitelist).and_return(['OU=Groups'])
249
+ end
250
+ it 'should return true' do
251
+ expect(user.member_of_ldap_group?('Top-Group')).to eq(true)
252
+ end
252
253
  end
253
- end
254
- context 'when the group is not whitelisted' do
255
- before do
256
- allow(LDAPGroupsLookup).to receive(:member_whitelist).and_return(['OU=Not-A-Match'])
254
+ context 'when the whitelist is empty' do
255
+ before do
256
+ allow(LDAPGroupsLookup).to receive(:member_whitelist).and_return([])
257
+ end
258
+ it 'should return true (whitelisting is disabled)' do
259
+ expect(user.member_of_ldap_group?('Top-Group')).to eq(true)
260
+ end
257
261
  end
258
- it 'should return false' do
259
- expect(user.member_of_ldap_group?('Top-Group')).to eq(false)
262
+ context 'when the group is not whitelisted' do
263
+ before do
264
+ allow(LDAPGroupsLookup).to receive(:member_whitelist).and_return(['OU=Not-A-Match'])
265
+ end
266
+ it 'should return false' do
267
+ expect(user.member_of_ldap_group?('Top-Group')).to eq(false)
268
+ end
260
269
  end
261
270
  end
262
271
  end
263
272
  end
264
273
  end
265
274
  end
266
- end
275
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ldap_groups_lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Ploshay