net-ldap 0.16.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/History.rdoc +64 -0
- data/README.rdoc +18 -6
- data/lib/net/ber/core_ext.rb +6 -6
- data/lib/net/ber.rb +2 -2
- data/lib/net/ldap/auth_adapter/gss_spnego.rb +2 -2
- data/lib/net/ldap/auth_adapter/sasl.rb +1 -1
- data/lib/net/ldap/auth_adapter/simple.rb +1 -1
- data/lib/net/ldap/connection.rb +23 -16
- data/lib/net/ldap/dataset.rb +1 -3
- data/lib/net/ldap/dn.rb +14 -22
- data/lib/net/ldap/entry.rb +11 -2
- data/lib/net/ldap/error.rb +2 -26
- data/lib/net/ldap/filter.rb +10 -3
- data/lib/net/ldap/instrumentation.rb +2 -2
- data/lib/net/ldap/password.rb +7 -5
- data/lib/net/ldap/pdu.rb +1 -1
- data/lib/net/ldap/version.rb +1 -1
- data/lib/net/ldap.rb +40 -17
- data/lib/net/snmp.rb +1 -1
- data/lib/net-ldap.rb +1 -1
- metadata +16 -106
- data/.gitignore +0 -9
- data/.rubocop.yml +0 -20
- data/.rubocop_todo.yml +0 -753
- data/.travis.yml +0 -33
- data/CONTRIBUTING.md +0 -54
- data/Gemfile +0 -2
- data/Rakefile +0 -23
- data/net-ldap.gemspec +0 -37
- data/script/changelog +0 -47
- data/script/generate-fixture-ca +0 -48
- data/script/install-openldap +0 -134
- data/script/package +0 -7
- data/script/release +0 -16
- data/test/ber/core_ext/test_array.rb +0 -22
- data/test/ber/core_ext/test_string.rb +0 -25
- data/test/ber/test_ber.rb +0 -153
- data/test/fixtures/ca/ca.info +0 -4
- data/test/fixtures/ca/cacert.pem +0 -24
- data/test/fixtures/ca/cakey.pem +0 -190
- data/test/fixtures/openldap/memberof.ldif +0 -33
- data/test/fixtures/openldap/retcode.ldif +0 -76
- data/test/fixtures/openldap/slapd.conf.ldif +0 -67
- data/test/fixtures/seed.ldif +0 -374
- data/test/integration/test_add.rb +0 -28
- data/test/integration/test_ber.rb +0 -30
- data/test/integration/test_bind.rb +0 -244
- data/test/integration/test_delete.rb +0 -31
- data/test/integration/test_open.rb +0 -88
- data/test/integration/test_password_modify.rb +0 -80
- data/test/integration/test_return_codes.rb +0 -38
- data/test/integration/test_search.rb +0 -77
- data/test/support/vm/openldap/.gitignore +0 -1
- data/test/support/vm/openldap/README.md +0 -64
- data/test/support/vm/openldap/Vagrantfile +0 -34
- data/test/test_auth_adapter.rb +0 -15
- data/test/test_dn.rb +0 -44
- data/test/test_entry.rb +0 -65
- data/test/test_filter.rb +0 -223
- data/test/test_filter_parser.rb +0 -24
- data/test/test_helper.rb +0 -74
- data/test/test_ldap.rb +0 -114
- data/test/test_ldap_connection.rb +0 -491
- data/test/test_ldif.rb +0 -104
- data/test/test_password.rb +0 -10
- data/test/test_rename.rb +0 -77
- data/test/test_search.rb +0 -39
- data/test/test_snmp.rb +0 -119
- data/test/test_ssl_ber.rb +0 -40
- data/test/testdata.ldif +0 -101
- data/testserver/ldapserver.rb +0 -209
- data/testserver/testdata.ldif +0 -101
data/test/fixtures/seed.ldif
DELETED
@@ -1,374 +0,0 @@
|
|
1
|
-
dn: ou=People,dc=rubyldap,dc=com
|
2
|
-
objectClass: top
|
3
|
-
objectClass: organizationalUnit
|
4
|
-
ou: People
|
5
|
-
|
6
|
-
dn: ou=Groups,dc=rubyldap,dc=com
|
7
|
-
objectClass: top
|
8
|
-
objectClass: organizationalUnit
|
9
|
-
ou: Groups
|
10
|
-
|
11
|
-
# Directory Superuser
|
12
|
-
dn: uid=admin,dc=rubyldap,dc=com
|
13
|
-
uid: admin
|
14
|
-
cn: system administrator
|
15
|
-
sn: administrator
|
16
|
-
objectClass: top
|
17
|
-
objectClass: person
|
18
|
-
objectClass: organizationalPerson
|
19
|
-
objectClass: inetOrgPerson
|
20
|
-
displayName: Directory Superuser
|
21
|
-
userPassword: passworD1
|
22
|
-
|
23
|
-
# Users 1-10
|
24
|
-
|
25
|
-
dn: uid=user1,ou=People,dc=rubyldap,dc=com
|
26
|
-
uid: user1
|
27
|
-
cn: user1
|
28
|
-
sn: user1
|
29
|
-
objectClass: top
|
30
|
-
objectClass: person
|
31
|
-
objectClass: organizationalPerson
|
32
|
-
objectClass: inetOrgPerson
|
33
|
-
userPassword: passworD1
|
34
|
-
mail: user1@rubyldap.com
|
35
|
-
|
36
|
-
dn: uid=user2,ou=People,dc=rubyldap,dc=com
|
37
|
-
uid: user2
|
38
|
-
cn: user2
|
39
|
-
sn: user2
|
40
|
-
objectClass: top
|
41
|
-
objectClass: person
|
42
|
-
objectClass: organizationalPerson
|
43
|
-
objectClass: inetOrgPerson
|
44
|
-
userPassword: passworD1
|
45
|
-
mail: user2@rubyldap.com
|
46
|
-
|
47
|
-
dn: uid=user3,ou=People,dc=rubyldap,dc=com
|
48
|
-
uid: user3
|
49
|
-
cn: user3
|
50
|
-
sn: user3
|
51
|
-
objectClass: top
|
52
|
-
objectClass: person
|
53
|
-
objectClass: organizationalPerson
|
54
|
-
objectClass: inetOrgPerson
|
55
|
-
userPassword: passworD1
|
56
|
-
mail: user3@rubyldap.com
|
57
|
-
|
58
|
-
dn: uid=user4,ou=People,dc=rubyldap,dc=com
|
59
|
-
uid: user4
|
60
|
-
cn: user4
|
61
|
-
sn: user4
|
62
|
-
objectClass: top
|
63
|
-
objectClass: person
|
64
|
-
objectClass: organizationalPerson
|
65
|
-
objectClass: inetOrgPerson
|
66
|
-
userPassword: passworD1
|
67
|
-
mail: user4@rubyldap.com
|
68
|
-
|
69
|
-
dn: uid=user5,ou=People,dc=rubyldap,dc=com
|
70
|
-
uid: user5
|
71
|
-
cn: user5
|
72
|
-
sn: user5
|
73
|
-
objectClass: top
|
74
|
-
objectClass: person
|
75
|
-
objectClass: organizationalPerson
|
76
|
-
objectClass: inetOrgPerson
|
77
|
-
userPassword: passworD1
|
78
|
-
mail: user5@rubyldap.com
|
79
|
-
|
80
|
-
dn: uid=user6,ou=People,dc=rubyldap,dc=com
|
81
|
-
uid: user6
|
82
|
-
cn: user6
|
83
|
-
sn: user6
|
84
|
-
objectClass: top
|
85
|
-
objectClass: person
|
86
|
-
objectClass: organizationalPerson
|
87
|
-
objectClass: inetOrgPerson
|
88
|
-
userPassword: passworD1
|
89
|
-
mail: user6@rubyldap.com
|
90
|
-
|
91
|
-
dn: uid=user7,ou=People,dc=rubyldap,dc=com
|
92
|
-
uid: user7
|
93
|
-
cn: user7
|
94
|
-
sn: user7
|
95
|
-
objectClass: top
|
96
|
-
objectClass: person
|
97
|
-
objectClass: organizationalPerson
|
98
|
-
objectClass: inetOrgPerson
|
99
|
-
userPassword: passworD1
|
100
|
-
mail: user7@rubyldap.com
|
101
|
-
|
102
|
-
dn: uid=user8,ou=People,dc=rubyldap,dc=com
|
103
|
-
uid: user8
|
104
|
-
cn: user8
|
105
|
-
sn: user8
|
106
|
-
objectClass: top
|
107
|
-
objectClass: person
|
108
|
-
objectClass: organizationalPerson
|
109
|
-
objectClass: inetOrgPerson
|
110
|
-
userPassword: passworD1
|
111
|
-
mail: user8@rubyldap.com
|
112
|
-
|
113
|
-
dn: uid=user9,ou=People,dc=rubyldap,dc=com
|
114
|
-
uid: user9
|
115
|
-
cn: user9
|
116
|
-
sn: user9
|
117
|
-
objectClass: top
|
118
|
-
objectClass: person
|
119
|
-
objectClass: organizationalPerson
|
120
|
-
objectClass: inetOrgPerson
|
121
|
-
userPassword: passworD1
|
122
|
-
mail: user9@rubyldap.com
|
123
|
-
|
124
|
-
dn: uid=user10,ou=People,dc=rubyldap,dc=com
|
125
|
-
uid: user10
|
126
|
-
cn: user10
|
127
|
-
sn: user10
|
128
|
-
objectClass: top
|
129
|
-
objectClass: person
|
130
|
-
objectClass: organizationalPerson
|
131
|
-
objectClass: inetOrgPerson
|
132
|
-
userPassword: passworD1
|
133
|
-
mail: user10@rubyldap.com
|
134
|
-
|
135
|
-
# Emailless User
|
136
|
-
|
137
|
-
dn: uid=emailless-user1,ou=People,dc=rubyldap,dc=com
|
138
|
-
uid: emailless-user1
|
139
|
-
cn: emailless-user1
|
140
|
-
sn: emailless-user1
|
141
|
-
objectClass: top
|
142
|
-
objectClass: person
|
143
|
-
objectClass: organizationalPerson
|
144
|
-
objectClass: inetOrgPerson
|
145
|
-
userPassword: passworD1
|
146
|
-
|
147
|
-
# Groupless User
|
148
|
-
|
149
|
-
dn: uid=groupless-user1,ou=People,dc=rubyldap,dc=com
|
150
|
-
uid: groupless-user1
|
151
|
-
cn: groupless-user1
|
152
|
-
sn: groupless-user1
|
153
|
-
objectClass: top
|
154
|
-
objectClass: person
|
155
|
-
objectClass: organizationalPerson
|
156
|
-
objectClass: inetOrgPerson
|
157
|
-
userPassword: passworD1
|
158
|
-
|
159
|
-
# Admin User
|
160
|
-
|
161
|
-
dn: uid=admin1,ou=People,dc=rubyldap,dc=com
|
162
|
-
uid: admin1
|
163
|
-
cn: admin1
|
164
|
-
sn: admin1
|
165
|
-
objectClass: top
|
166
|
-
objectClass: person
|
167
|
-
objectClass: organizationalPerson
|
168
|
-
objectClass: inetOrgPerson
|
169
|
-
userPassword: passworD1
|
170
|
-
mail: admin1@rubyldap.com
|
171
|
-
|
172
|
-
# Groups
|
173
|
-
|
174
|
-
dn: cn=ghe-users,ou=Groups,dc=rubyldap,dc=com
|
175
|
-
cn: ghe-users
|
176
|
-
objectClass: groupOfNames
|
177
|
-
member: uid=user1,ou=People,dc=rubyldap,dc=com
|
178
|
-
member: uid=emailless-user1,ou=People,dc=rubyldap,dc=com
|
179
|
-
|
180
|
-
dn: cn=all-users,ou=Groups,dc=rubyldap,dc=com
|
181
|
-
cn: all-users
|
182
|
-
objectClass: groupOfNames
|
183
|
-
member: cn=ghe-users,ou=Groups,dc=rubyldap,dc=com
|
184
|
-
member: uid=user1,ou=People,dc=rubyldap,dc=com
|
185
|
-
member: uid=user2,ou=People,dc=rubyldap,dc=com
|
186
|
-
member: uid=user3,ou=People,dc=rubyldap,dc=com
|
187
|
-
member: uid=user4,ou=People,dc=rubyldap,dc=com
|
188
|
-
member: uid=user5,ou=People,dc=rubyldap,dc=com
|
189
|
-
member: uid=user6,ou=People,dc=rubyldap,dc=com
|
190
|
-
member: uid=user7,ou=People,dc=rubyldap,dc=com
|
191
|
-
member: uid=user8,ou=People,dc=rubyldap,dc=com
|
192
|
-
member: uid=user9,ou=People,dc=rubyldap,dc=com
|
193
|
-
member: uid=user10,ou=People,dc=rubyldap,dc=com
|
194
|
-
member: uid=emailless-user1,ou=People,dc=rubyldap,dc=com
|
195
|
-
|
196
|
-
dn: cn=ghe-admins,ou=Groups,dc=rubyldap,dc=com
|
197
|
-
cn: ghe-admins
|
198
|
-
objectClass: groupOfNames
|
199
|
-
member: uid=admin1,ou=People,dc=rubyldap,dc=com
|
200
|
-
|
201
|
-
dn: cn=all-admins,ou=Groups,dc=rubyldap,dc=com
|
202
|
-
cn: all-admins
|
203
|
-
objectClass: groupOfNames
|
204
|
-
member: cn=ghe-admins,ou=Groups,dc=rubyldap,dc=com
|
205
|
-
member: uid=admin1,ou=People,dc=rubyldap,dc=com
|
206
|
-
|
207
|
-
dn: cn=n-member-group10,ou=Groups,dc=rubyldap,dc=com
|
208
|
-
cn: n-member-group10
|
209
|
-
objectClass: groupOfNames
|
210
|
-
member: uid=user1,ou=People,dc=rubyldap,dc=com
|
211
|
-
member: uid=user2,ou=People,dc=rubyldap,dc=com
|
212
|
-
member: uid=user3,ou=People,dc=rubyldap,dc=com
|
213
|
-
member: uid=user4,ou=People,dc=rubyldap,dc=com
|
214
|
-
member: uid=user5,ou=People,dc=rubyldap,dc=com
|
215
|
-
member: uid=user6,ou=People,dc=rubyldap,dc=com
|
216
|
-
member: uid=user7,ou=People,dc=rubyldap,dc=com
|
217
|
-
member: uid=user8,ou=People,dc=rubyldap,dc=com
|
218
|
-
member: uid=user9,ou=People,dc=rubyldap,dc=com
|
219
|
-
member: uid=user10,ou=People,dc=rubyldap,dc=com
|
220
|
-
|
221
|
-
dn: cn=nested-group1,ou=Groups,dc=rubyldap,dc=com
|
222
|
-
cn: nested-group1
|
223
|
-
objectClass: groupOfNames
|
224
|
-
member: uid=user1,ou=People,dc=rubyldap,dc=com
|
225
|
-
member: uid=user2,ou=People,dc=rubyldap,dc=com
|
226
|
-
member: uid=user3,ou=People,dc=rubyldap,dc=com
|
227
|
-
member: uid=user4,ou=People,dc=rubyldap,dc=com
|
228
|
-
member: uid=user5,ou=People,dc=rubyldap,dc=com
|
229
|
-
|
230
|
-
dn: cn=nested-group2,ou=Groups,dc=rubyldap,dc=com
|
231
|
-
cn: nested-group2
|
232
|
-
objectClass: groupOfNames
|
233
|
-
member: uid=user6,ou=People,dc=rubyldap,dc=com
|
234
|
-
member: uid=user7,ou=People,dc=rubyldap,dc=com
|
235
|
-
member: uid=user8,ou=People,dc=rubyldap,dc=com
|
236
|
-
member: uid=user9,ou=People,dc=rubyldap,dc=com
|
237
|
-
member: uid=user10,ou=People,dc=rubyldap,dc=com
|
238
|
-
|
239
|
-
dn: cn=nested-groups,ou=Groups,dc=rubyldap,dc=com
|
240
|
-
cn: nested-groups
|
241
|
-
objectClass: groupOfNames
|
242
|
-
member: cn=nested-group1,ou=Groups,dc=rubyldap,dc=com
|
243
|
-
member: cn=nested-group2,ou=Groups,dc=rubyldap,dc=com
|
244
|
-
|
245
|
-
dn: cn=n-member-nested-group1,ou=Groups,dc=rubyldap,dc=com
|
246
|
-
cn: n-member-nested-group1
|
247
|
-
objectClass: groupOfNames
|
248
|
-
member: cn=nested-group1,ou=Groups,dc=rubyldap,dc=com
|
249
|
-
|
250
|
-
dn: cn=deeply-nested-group0.0.0,ou=Groups,dc=rubyldap,dc=com
|
251
|
-
cn: deeply-nested-group0.0.0
|
252
|
-
objectClass: groupOfNames
|
253
|
-
member: uid=user1,ou=People,dc=rubyldap,dc=com
|
254
|
-
member: uid=user2,ou=People,dc=rubyldap,dc=com
|
255
|
-
member: uid=user3,ou=People,dc=rubyldap,dc=com
|
256
|
-
member: uid=user4,ou=People,dc=rubyldap,dc=com
|
257
|
-
member: uid=user5,ou=People,dc=rubyldap,dc=com
|
258
|
-
|
259
|
-
dn: cn=deeply-nested-group0.0.1,ou=Groups,dc=rubyldap,dc=com
|
260
|
-
cn: deeply-nested-group0.0.1
|
261
|
-
objectClass: groupOfNames
|
262
|
-
member: uid=user6,ou=People,dc=rubyldap,dc=com
|
263
|
-
member: uid=user7,ou=People,dc=rubyldap,dc=com
|
264
|
-
member: uid=user8,ou=People,dc=rubyldap,dc=com
|
265
|
-
member: uid=user9,ou=People,dc=rubyldap,dc=com
|
266
|
-
member: uid=user10,ou=People,dc=rubyldap,dc=com
|
267
|
-
|
268
|
-
dn: cn=deeply-nested-group0.0,ou=Groups,dc=rubyldap,dc=com
|
269
|
-
cn: deeply-nested-group0.0
|
270
|
-
objectClass: groupOfNames
|
271
|
-
member: cn=deeply-nested-group0.0.0,ou=Groups,dc=rubyldap,dc=com
|
272
|
-
member: cn=deeply-nested-group0.0.1,ou=Groups,dc=rubyldap,dc=com
|
273
|
-
|
274
|
-
dn: cn=deeply-nested-group0,ou=Groups,dc=rubyldap,dc=com
|
275
|
-
cn: deeply-nested-group0
|
276
|
-
objectClass: groupOfNames
|
277
|
-
member: cn=deeply-nested-group0.0,ou=Groups,dc=rubyldap,dc=com
|
278
|
-
|
279
|
-
dn: cn=deeply-nested-groups,ou=Groups,dc=rubyldap,dc=com
|
280
|
-
cn: deeply-nested-groups
|
281
|
-
objectClass: groupOfNames
|
282
|
-
member: cn=deeply-nested-group0,ou=Groups,dc=rubyldap,dc=com
|
283
|
-
|
284
|
-
dn: cn=n-depth-nested-group1,ou=Groups,dc=rubyldap,dc=com
|
285
|
-
cn: n-depth-nested-group1
|
286
|
-
objectClass: groupOfNames
|
287
|
-
member: cn=nested-group1,ou=Groups,dc=rubyldap,dc=com
|
288
|
-
|
289
|
-
dn: cn=n-depth-nested-group2,ou=Groups,dc=rubyldap,dc=com
|
290
|
-
cn: n-depth-nested-group2
|
291
|
-
objectClass: groupOfNames
|
292
|
-
member: cn=n-depth-nested-group1,ou=Groups,dc=rubyldap,dc=com
|
293
|
-
|
294
|
-
dn: cn=n-depth-nested-group3,ou=Groups,dc=rubyldap,dc=com
|
295
|
-
cn: n-depth-nested-group3
|
296
|
-
objectClass: groupOfNames
|
297
|
-
member: cn=n-depth-nested-group2,ou=Groups,dc=rubyldap,dc=com
|
298
|
-
|
299
|
-
dn: cn=n-depth-nested-group4,ou=Groups,dc=rubyldap,dc=com
|
300
|
-
cn: n-depth-nested-group4
|
301
|
-
objectClass: groupOfNames
|
302
|
-
member: cn=n-depth-nested-group3,ou=Groups,dc=rubyldap,dc=com
|
303
|
-
|
304
|
-
dn: cn=n-depth-nested-group5,ou=Groups,dc=rubyldap,dc=com
|
305
|
-
cn: n-depth-nested-group5
|
306
|
-
objectClass: groupOfNames
|
307
|
-
member: cn=n-depth-nested-group4,ou=Groups,dc=rubyldap,dc=com
|
308
|
-
|
309
|
-
dn: cn=n-depth-nested-group6,ou=Groups,dc=rubyldap,dc=com
|
310
|
-
cn: n-depth-nested-group6
|
311
|
-
objectClass: groupOfNames
|
312
|
-
member: cn=n-depth-nested-group5,ou=Groups,dc=rubyldap,dc=com
|
313
|
-
|
314
|
-
dn: cn=n-depth-nested-group7,ou=Groups,dc=rubyldap,dc=com
|
315
|
-
cn: n-depth-nested-group7
|
316
|
-
objectClass: groupOfNames
|
317
|
-
member: cn=n-depth-nested-group6,ou=Groups,dc=rubyldap,dc=com
|
318
|
-
|
319
|
-
dn: cn=n-depth-nested-group8,ou=Groups,dc=rubyldap,dc=com
|
320
|
-
cn: n-depth-nested-group8
|
321
|
-
objectClass: groupOfNames
|
322
|
-
member: cn=n-depth-nested-group7,ou=Groups,dc=rubyldap,dc=com
|
323
|
-
|
324
|
-
dn: cn=n-depth-nested-group9,ou=Groups,dc=rubyldap,dc=com
|
325
|
-
cn: n-depth-nested-group9
|
326
|
-
objectClass: groupOfNames
|
327
|
-
member: cn=n-depth-nested-group8,ou=Groups,dc=rubyldap,dc=com
|
328
|
-
|
329
|
-
dn: cn=head-group,ou=Groups,dc=rubyldap,dc=com
|
330
|
-
cn: head-group
|
331
|
-
objectClass: groupOfNames
|
332
|
-
member: cn=tail-group,ou=Groups,dc=rubyldap,dc=com
|
333
|
-
member: uid=user1,ou=People,dc=rubyldap,dc=com
|
334
|
-
member: uid=user2,ou=People,dc=rubyldap,dc=com
|
335
|
-
member: uid=user3,ou=People,dc=rubyldap,dc=com
|
336
|
-
member: uid=user4,ou=People,dc=rubyldap,dc=com
|
337
|
-
member: uid=user5,ou=People,dc=rubyldap,dc=com
|
338
|
-
|
339
|
-
dn: cn=tail-group,ou=Groups,dc=rubyldap,dc=com
|
340
|
-
cn: tail-group
|
341
|
-
objectClass: groupOfNames
|
342
|
-
member: cn=head-group,ou=Groups,dc=rubyldap,dc=com
|
343
|
-
member: uid=user6,ou=People,dc=rubyldap,dc=com
|
344
|
-
member: uid=user7,ou=People,dc=rubyldap,dc=com
|
345
|
-
member: uid=user8,ou=People,dc=rubyldap,dc=com
|
346
|
-
member: uid=user9,ou=People,dc=rubyldap,dc=com
|
347
|
-
member: uid=user10,ou=People,dc=rubyldap,dc=com
|
348
|
-
|
349
|
-
dn: cn=recursively-nested-groups,ou=Groups,dc=rubyldap,dc=com
|
350
|
-
cn: recursively-nested-groups
|
351
|
-
objectClass: groupOfNames
|
352
|
-
member: cn=head-group,ou=Groups,dc=rubyldap,dc=com
|
353
|
-
member: cn=tail-group,ou=Groups,dc=rubyldap,dc=com
|
354
|
-
|
355
|
-
# posixGroup
|
356
|
-
|
357
|
-
dn: cn=posix-group1,ou=Groups,dc=rubyldap,dc=com
|
358
|
-
cn: posix-group1
|
359
|
-
objectClass: posixGroup
|
360
|
-
gidNumber: 1001
|
361
|
-
memberUid: user1
|
362
|
-
memberUid: user2
|
363
|
-
memberUid: user3
|
364
|
-
memberUid: user4
|
365
|
-
memberUid: user5
|
366
|
-
|
367
|
-
# missing members
|
368
|
-
|
369
|
-
dn: cn=missing-users,ou=Groups,dc=rubyldap,dc=com
|
370
|
-
cn: missing-users
|
371
|
-
objectClass: groupOfNames
|
372
|
-
member: uid=user1,ou=People,dc=rubyldap,dc=com
|
373
|
-
member: uid=user2,ou=People,dc=rubyldap,dc=com
|
374
|
-
member: uid=nonexistent-user,ou=People,dc=rubyldap,dc=com
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require_relative '../test_helper'
|
2
|
-
|
3
|
-
class TestAddIntegration < LDAPIntegrationTestCase
|
4
|
-
def setup
|
5
|
-
super
|
6
|
-
@ldap.authenticate "cn=admin,dc=rubyldap,dc=com", "passworD1"
|
7
|
-
|
8
|
-
@dn = "uid=added-user1,ou=People,dc=rubyldap,dc=com"
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_add
|
12
|
-
attrs = {
|
13
|
-
objectclass: %w(top inetOrgPerson organizationalPerson person),
|
14
|
-
uid: "added-user1",
|
15
|
-
cn: "added-user1",
|
16
|
-
sn: "added-user1",
|
17
|
-
mail: "added-user1@rubyldap.com",
|
18
|
-
}
|
19
|
-
|
20
|
-
assert @ldap.add(dn: @dn, attributes: attrs), @ldap.get_operation_result.inspect
|
21
|
-
|
22
|
-
assert result = @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject).first
|
23
|
-
end
|
24
|
-
|
25
|
-
def teardown
|
26
|
-
@ldap.delete dn: @dn
|
27
|
-
end
|
28
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require_relative '../test_helper'
|
2
|
-
|
3
|
-
class TestBERIntegration < LDAPIntegrationTestCase
|
4
|
-
# Test whether the TRUE boolean value is encoded correctly by performing a
|
5
|
-
# search operation.
|
6
|
-
def test_true_ber_encoding
|
7
|
-
# request these attrs to simplify test; use symbols to match Entry#attribute_names
|
8
|
-
attrs = [:dn, :uid, :cn, :mail]
|
9
|
-
|
10
|
-
assert types_entry = @ldap.search(
|
11
|
-
base: "dc=rubyldap,dc=com",
|
12
|
-
filter: "(uid=user1)",
|
13
|
-
size: 1,
|
14
|
-
attributes: attrs,
|
15
|
-
attributes_only: true,
|
16
|
-
).first
|
17
|
-
|
18
|
-
# matches attributes we requested
|
19
|
-
assert_equal attrs, types_entry.attribute_names
|
20
|
-
|
21
|
-
# assert values are empty
|
22
|
-
types_entry.each do |name, values|
|
23
|
-
next if name == :dn
|
24
|
-
assert values.empty?
|
25
|
-
end
|
26
|
-
|
27
|
-
assert_includes Net::LDAP::ResultCodesSearchSuccess,
|
28
|
-
@ldap.get_operation_result.code, "should be a successful search operation"
|
29
|
-
end
|
30
|
-
end
|
@@ -1,244 +0,0 @@
|
|
1
|
-
require_relative '../test_helper'
|
2
|
-
|
3
|
-
class TestBindIntegration < LDAPIntegrationTestCase
|
4
|
-
def test_bind_success
|
5
|
-
assert @ldap.bind(BIND_CREDS),
|
6
|
-
@ldap.get_operation_result.inspect
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_bind_timeout
|
10
|
-
@ldap.port = 8389
|
11
|
-
error = assert_raise Net::LDAP::Error do
|
12
|
-
@ldap.bind BIND_CREDS
|
13
|
-
end
|
14
|
-
msgs = ['Operation timed out - user specified timeout',
|
15
|
-
'Connection timed out - user specified timeout']
|
16
|
-
assert_send([msgs, :include?, error.message])
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_bind_anonymous_fail
|
20
|
-
refute @ldap.bind(BIND_CREDS.merge(password: '')),
|
21
|
-
@ldap.get_operation_result.inspect
|
22
|
-
|
23
|
-
result = @ldap.get_operation_result
|
24
|
-
assert_equal Net::LDAP::ResultCodeUnwillingToPerform, result.code
|
25
|
-
assert_equal Net::LDAP::ResultStrings[Net::LDAP::ResultCodeUnwillingToPerform], result.message
|
26
|
-
assert_equal "unauthenticated bind (DN with no password) disallowed",
|
27
|
-
result.error_message
|
28
|
-
assert_equal "", result.matched_dn
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_bind_fail
|
32
|
-
refute @ldap.bind(BIND_CREDS.merge(password: "not my password")),
|
33
|
-
@ldap.get_operation_result.inspect
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_bind_tls_with_cafile
|
37
|
-
@ldap.encryption(
|
38
|
-
method: :start_tls,
|
39
|
-
tls_options: TLS_OPTS.merge(ca_file: CA_FILE),
|
40
|
-
)
|
41
|
-
assert @ldap.bind(BIND_CREDS),
|
42
|
-
@ldap.get_operation_result.inspect
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_bind_tls_with_bad_hostname_verify_none_no_ca_passes
|
46
|
-
@ldap.host = '127.0.0.1'
|
47
|
-
@ldap.encryption(
|
48
|
-
method: :start_tls,
|
49
|
-
tls_options: { verify_mode: OpenSSL::SSL::VERIFY_NONE },
|
50
|
-
)
|
51
|
-
assert @ldap.bind(BIND_CREDS),
|
52
|
-
@ldap.get_operation_result.inspect
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_bind_tls_with_bad_hostname_verify_none_no_ca_opt_merge_passes
|
56
|
-
@ldap.host = '127.0.0.1'
|
57
|
-
@ldap.encryption(
|
58
|
-
method: :start_tls,
|
59
|
-
tls_options: TLS_OPTS.merge(verify_mode: OpenSSL::SSL::VERIFY_NONE),
|
60
|
-
)
|
61
|
-
assert @ldap.bind(BIND_CREDS),
|
62
|
-
@ldap.get_operation_result.inspect
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_bind_tls_with_bad_hostname_verify_peer_ca_fails
|
66
|
-
@ldap.host = '127.0.0.1'
|
67
|
-
@ldap.encryption(
|
68
|
-
method: :start_tls,
|
69
|
-
tls_options: { verify_mode: OpenSSL::SSL::VERIFY_PEER,
|
70
|
-
ca_file: CA_FILE },
|
71
|
-
)
|
72
|
-
error = assert_raise Net::LDAP::Error,
|
73
|
-
Net::LDAP::ConnectionRefusedError do
|
74
|
-
@ldap.bind BIND_CREDS
|
75
|
-
end
|
76
|
-
assert_equal(
|
77
|
-
"hostname \"#{@ldap.host}\" does not match the server certificate",
|
78
|
-
error.message,
|
79
|
-
)
|
80
|
-
end
|
81
|
-
|
82
|
-
def test_bind_tls_with_bad_hostname_ca_default_opt_merge_fails
|
83
|
-
@ldap.host = '127.0.0.1'
|
84
|
-
@ldap.encryption(
|
85
|
-
method: :start_tls,
|
86
|
-
tls_options: TLS_OPTS.merge(ca_file: CA_FILE),
|
87
|
-
)
|
88
|
-
error = assert_raise Net::LDAP::Error,
|
89
|
-
Net::LDAP::ConnectionRefusedError do
|
90
|
-
@ldap.bind BIND_CREDS
|
91
|
-
end
|
92
|
-
assert_equal(
|
93
|
-
"hostname \"#{@ldap.host}\" does not match the server certificate",
|
94
|
-
error.message,
|
95
|
-
)
|
96
|
-
end
|
97
|
-
|
98
|
-
def test_bind_tls_with_bad_hostname_ca_no_opt_merge_fails
|
99
|
-
@ldap.host = '127.0.0.1'
|
100
|
-
@ldap.encryption(
|
101
|
-
method: :start_tls,
|
102
|
-
tls_options: { ca_file: CA_FILE },
|
103
|
-
)
|
104
|
-
error = assert_raise Net::LDAP::Error,
|
105
|
-
Net::LDAP::ConnectionRefusedError do
|
106
|
-
@ldap.bind BIND_CREDS
|
107
|
-
end
|
108
|
-
assert_equal(
|
109
|
-
"hostname \"#{@ldap.host}\" does not match the server certificate",
|
110
|
-
error.message,
|
111
|
-
)
|
112
|
-
end
|
113
|
-
|
114
|
-
def test_bind_tls_with_valid_hostname_default_opts_passes
|
115
|
-
@ldap.host = 'localhost'
|
116
|
-
@ldap.encryption(
|
117
|
-
method: :start_tls,
|
118
|
-
tls_options: TLS_OPTS.merge(verify_mode: OpenSSL::SSL::VERIFY_PEER,
|
119
|
-
ca_file: CA_FILE),
|
120
|
-
)
|
121
|
-
assert @ldap.bind(BIND_CREDS),
|
122
|
-
@ldap.get_operation_result.inspect
|
123
|
-
end
|
124
|
-
|
125
|
-
def test_bind_tls_with_valid_hostname_just_verify_peer_ca_passes
|
126
|
-
@ldap.host = 'localhost'
|
127
|
-
@ldap.encryption(
|
128
|
-
method: :start_tls,
|
129
|
-
tls_options: { verify_mode: OpenSSL::SSL::VERIFY_PEER,
|
130
|
-
ca_file: CA_FILE },
|
131
|
-
)
|
132
|
-
assert @ldap.bind(BIND_CREDS),
|
133
|
-
@ldap.get_operation_result.inspect
|
134
|
-
end
|
135
|
-
|
136
|
-
def test_bind_tls_with_bogus_hostname_system_ca_fails
|
137
|
-
@ldap.host = '127.0.0.1'
|
138
|
-
@ldap.encryption(method: :start_tls, tls_options: {})
|
139
|
-
error = assert_raise Net::LDAP::Error,
|
140
|
-
Net::LDAP::ConnectionRefusedError do
|
141
|
-
@ldap.bind BIND_CREDS
|
142
|
-
end
|
143
|
-
assert_equal(
|
144
|
-
"hostname \"#{@ldap.host}\" does not match the server certificate",
|
145
|
-
error.message,
|
146
|
-
)
|
147
|
-
end
|
148
|
-
|
149
|
-
# The following depend on /etc/hosts hacking.
|
150
|
-
# We can do that on CI, but it's less than cool on people's dev boxes
|
151
|
-
def test_bind_tls_with_multiple_hosts
|
152
|
-
omit_unless ENV['TRAVIS'] == 'true'
|
153
|
-
|
154
|
-
@ldap.host = nil
|
155
|
-
@ldap.hosts = [['ldap01.example.com', 389], ['ldap02.example.com', 389]]
|
156
|
-
@ldap.encryption(
|
157
|
-
method: :start_tls,
|
158
|
-
tls_options: TLS_OPTS.merge(verify_mode: OpenSSL::SSL::VERIFY_PEER,
|
159
|
-
ca_file: CA_FILE),
|
160
|
-
)
|
161
|
-
assert @ldap.bind(BIND_CREDS),
|
162
|
-
@ldap.get_operation_result.inspect
|
163
|
-
end
|
164
|
-
|
165
|
-
def test_bind_tls_with_multiple_bogus_hosts
|
166
|
-
omit_unless ENV['TRAVIS'] == 'true'
|
167
|
-
|
168
|
-
@ldap.host = nil
|
169
|
-
@ldap.hosts = [['127.0.0.1', 389], ['bogus.example.com', 389]]
|
170
|
-
@ldap.encryption(
|
171
|
-
method: :start_tls,
|
172
|
-
tls_options: TLS_OPTS.merge(verify_mode: OpenSSL::SSL::VERIFY_PEER,
|
173
|
-
ca_file: CA_FILE),
|
174
|
-
)
|
175
|
-
error = assert_raise Net::LDAP::Error,
|
176
|
-
Net::LDAP::ConnectionError do
|
177
|
-
@ldap.bind BIND_CREDS
|
178
|
-
end
|
179
|
-
assert_equal("Unable to connect to any given server: ",
|
180
|
-
error.message.split("\n").shift)
|
181
|
-
end
|
182
|
-
|
183
|
-
def test_bind_tls_with_multiple_bogus_hosts_no_verification
|
184
|
-
omit_unless ENV['TRAVIS'] == 'true'
|
185
|
-
|
186
|
-
@ldap.host = nil
|
187
|
-
@ldap.hosts = [['127.0.0.1', 389], ['bogus.example.com', 389]]
|
188
|
-
@ldap.encryption(
|
189
|
-
method: :start_tls,
|
190
|
-
tls_options: TLS_OPTS.merge(verify_mode: OpenSSL::SSL::VERIFY_NONE),
|
191
|
-
)
|
192
|
-
assert @ldap.bind(BIND_CREDS),
|
193
|
-
@ldap.get_operation_result.inspect
|
194
|
-
end
|
195
|
-
|
196
|
-
def test_bind_tls_with_multiple_bogus_hosts_ca_check_only_fails
|
197
|
-
omit_unless ENV['TRAVIS'] == 'true'
|
198
|
-
|
199
|
-
@ldap.host = nil
|
200
|
-
@ldap.hosts = [['127.0.0.1', 389], ['bogus.example.com', 389]]
|
201
|
-
@ldap.encryption(
|
202
|
-
method: :start_tls,
|
203
|
-
tls_options: { ca_file: CA_FILE },
|
204
|
-
)
|
205
|
-
error = assert_raise Net::LDAP::Error,
|
206
|
-
Net::LDAP::ConnectionError do
|
207
|
-
@ldap.bind BIND_CREDS
|
208
|
-
end
|
209
|
-
assert_equal("Unable to connect to any given server: ",
|
210
|
-
error.message.split("\n").shift)
|
211
|
-
end
|
212
|
-
|
213
|
-
# This test is CI-only because we can't add the fixture CA
|
214
|
-
# to the system CA store on people's dev boxes.
|
215
|
-
def test_bind_tls_valid_hostname_system_ca_on_travis_passes
|
216
|
-
omit_unless ENV['TRAVIS'] == 'true'
|
217
|
-
|
218
|
-
@ldap.encryption(
|
219
|
-
method: :start_tls,
|
220
|
-
tls_options: { verify_mode: OpenSSL::SSL::VERIFY_PEER },
|
221
|
-
)
|
222
|
-
assert @ldap.bind(BIND_CREDS),
|
223
|
-
@ldap.get_operation_result.inspect
|
224
|
-
end
|
225
|
-
|
226
|
-
# Inverse of the above! Don't run this on Travis, only on Vagrant.
|
227
|
-
# Since Vagrant's hypervisor *won't* have the CA in the system
|
228
|
-
# x509 store, we can assume validation will fail
|
229
|
-
def test_bind_tls_valid_hostname_system_on_vagrant_fails
|
230
|
-
omit_if ENV['TRAVIS'] == 'true'
|
231
|
-
|
232
|
-
@ldap.encryption(
|
233
|
-
method: :start_tls,
|
234
|
-
tls_options: { verify_mode: OpenSSL::SSL::VERIFY_PEER },
|
235
|
-
)
|
236
|
-
error = assert_raise Net::LDAP::Error do
|
237
|
-
@ldap.bind BIND_CREDS
|
238
|
-
end
|
239
|
-
assert_equal(
|
240
|
-
"SSL_connect returned=1 errno=0 state=error: certificate verify failed",
|
241
|
-
error.message,
|
242
|
-
)
|
243
|
-
end
|
244
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require_relative '../test_helper'
|
2
|
-
|
3
|
-
class TestDeleteIntegration < LDAPIntegrationTestCase
|
4
|
-
def setup
|
5
|
-
super
|
6
|
-
@ldap.authenticate "cn=admin,dc=rubyldap,dc=com", "passworD1"
|
7
|
-
|
8
|
-
@dn = "uid=delete-user1,ou=People,dc=rubyldap,dc=com"
|
9
|
-
|
10
|
-
attrs = {
|
11
|
-
objectclass: %w(top inetOrgPerson organizationalPerson person),
|
12
|
-
uid: "delete-user1",
|
13
|
-
cn: "delete-user1",
|
14
|
-
sn: "delete-user1",
|
15
|
-
mail: "delete-user1@rubyldap.com",
|
16
|
-
}
|
17
|
-
unless @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject)
|
18
|
-
assert @ldap.add(dn: @dn, attributes: attrs), @ldap.get_operation_result.inspect
|
19
|
-
end
|
20
|
-
assert @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject)
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_delete
|
24
|
-
assert @ldap.delete(dn: @dn), @ldap.get_operation_result.inspect
|
25
|
-
refute @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject)
|
26
|
-
|
27
|
-
result = @ldap.get_operation_result
|
28
|
-
assert_equal Net::LDAP::ResultCodeNoSuchObject, result.code
|
29
|
-
assert_equal Net::LDAP::ResultStrings[Net::LDAP::ResultCodeNoSuchObject], result.message
|
30
|
-
end
|
31
|
-
end
|