ruby-ldap 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ # $Id: ts_ldap.rb,v 1.1 2005/03/12 09:44:11 ianmacd Exp $
2
+ #
3
+ # Test suite runner for Ruby/LDAP.
4
+
5
+ require 'tc_conn'
6
+ require 'tc_schema'
7
+ require 'tc_search'
8
+ require 'tc_ldif'
@@ -0,0 +1,21 @@
1
+ /* -*- C -*-
2
+ * $Id: winlber.h,v 1.1.1.1 2002/11/06 07:56:34 ttate Exp $
3
+ * Copyright (C) 2001 Takaaki Tateishi <ttate@kt.jaist.ac.jp>
4
+ * References: MSDN Library, OpenLDAP, Cygwin
5
+ */
6
+
7
+ #ifndef WINLBER_H
8
+ #define WINLBER_H
9
+
10
+ #include <windows.h>
11
+
12
+ typedef struct berval {
13
+ ULONG bv_len;
14
+ PCHAR bv_val;
15
+ } LDAP_BERVAL, *PLDAP_BERVAL, BERVAL, *PBERVAL;
16
+
17
+ typedef struct berElement {
18
+ PCHAR opaque;
19
+ } BerElement;
20
+
21
+ #endif /* WINLBER_H */
@@ -0,0 +1,324 @@
1
+ /*
2
+ * $Id: winldap.h,v 1.6 2006/08/08 14:36:15 ianmacd Exp $
3
+ *
4
+ * Copyright (C) 2001 Takaaki Tateishi <ttate@kt.jaist.ac.jp>
5
+ * Copyright (C) 2006 Ian Macdonald <ian@caliban.org>
6
+ *
7
+ */
8
+
9
+ #ifndef WINLDAP_H
10
+ #define WINLDAP_H
11
+
12
+ #include <windows.h>
13
+
14
+ #define LDAP_VERSION1 1
15
+ #define LDAP_VERSION2 2
16
+ #define LDAP_VERSION3 3
17
+
18
+ #define LDAP_VERSION_MIN LDAP_VERSION2
19
+ #define LDAP_VERSION LDAP_VERSION2
20
+ #define LDAP_VERSION_MAX LDAP_VERSION3
21
+
22
+ /*
23
+ #define LDAP_API_VERSION
24
+ #define LDAP_APIINFO_VERSION
25
+ */
26
+ #define LDAP_VENDOR_NAME "Unknown"
27
+
28
+ #define LDAP_PORT 389
29
+ #define LDAP_SLL_PORT 636
30
+
31
+ #define LDAP_SCOPE_BASE 0x00
32
+ #define LDAP_SCOPE_ONELEVEL 0x01
33
+ #define LDAP_SCOPE_SUBTREE 0x02
34
+
35
+ #define LDAP_SUCCESS 0x00
36
+ #define LDAP_OPERATIONS_ERROR 0x01
37
+ #define LDAP_PROTOCOL_ERROR 0x02
38
+ #define LDAP_TIMELIMIT_EXCEEDED 0x03
39
+ #define LDAP_SIZELIMIT_EXCEEDED 0x04
40
+ #define LDAP_COMPARE_FALSE 0x05
41
+ #define LDAP_COMPARE_TRUE 0x06
42
+ #define LDAP_AUTH_METHOD_NOT_SUPPORTED 0x07
43
+ #define LDAP_STRONG_AUTH_REQUIRED 0x08
44
+ #define LDAP_REFERRAL_V2 0x09
45
+ #define LDAP_PARTIAL_RESULTS 0x09
46
+ #define LDAP_REFERRAL 0x0a
47
+ #define LDAP_ADMIN_LIMIT_EXCEEDED 0x0b
48
+ #define LDAP_UNAVAILABLE_CRIT_EXTENSION 0x0c
49
+ #define LDAP_CONFIDENTIALITY_REQUIRED 0x0d
50
+
51
+ #define LDAP_NO_SUCH_ATTRIBUTE 0x10
52
+ #define LDAP_UNDEFINED_TYPE 0x11
53
+ #define LDAP_INAPPROPRIATE_MATCHING 0x12
54
+ #define LDAP_CONSTRAINT_VIOLATION 0x13
55
+ #define LDAP_ATTRIBUTE_OR_VALUE_EXISTS 0x14
56
+ #define LDAP_TYPE_OR_VALUE_EXISTS 0x14
57
+ #define LDAP_INVALID_SYNTAX 0x15
58
+
59
+ #define LDAP_NO_SUCH_OBJECT 0x20
60
+ #define LDAP_ALIAS_PROBLEM 0x21
61
+ #define LDAP_INVALID_DN_SYNTAX 0x22
62
+ #define LDAP_IS_LEAF 0x23
63
+ #define LDAP_ALIAS_DEREF_PROBLEM 0x24
64
+
65
+ #define LDAP_INAPPROPRIATE_AUTH 0x30
66
+ #define LDAP_INVALID_CREDENTIALS 0x31
67
+ #define LDAP_INSUFFICIENT_RIGHTS 0x32
68
+ #define LDAP_INSUFFICIENT_ACCESS 0x32
69
+ #define LDAP_BUSY 0x33
70
+ #define LDAP_UNAVAILABLE 0x34
71
+ #define LDAP_UNWILLING_TO_PERFORM 0x35
72
+ #define LDAP_LOOP_DETECT 0x36
73
+
74
+ #define LDAP_NAMING_VIOLATION 0x40
75
+ #define LDAP_OBJECT_CLASS_VIOLATION 0x41
76
+ #define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42
77
+ #define LDAP_NOT_ALLOWED_ON_RDN 0x43
78
+ #define LDAP_ALREADY_EXISTS 0x44
79
+ #define LDAP_NO_OBJECT_CLASS_MODS 0x45
80
+ #define LDAP_RESULTS_TOO_LARGE 0x46
81
+ #define LDAP_AFFECTS_MULTIPLE_DSAS 0x47
82
+
83
+ #define LDAP_OTHER 0x50
84
+ #define LDAP_SERVER_DOWN 0x51
85
+ #define LDAP_LOCAL_ERROR 0x52
86
+ #define LDAP_ENCODING_ERROR 0x53
87
+ #define LDAP_DECODING_ERROR 0x54
88
+ #define LDAP_TIMEOUT 0x55
89
+ #define LDAP_AUTH_UNKNOWN 0x56
90
+ #define LDAP_FILTER_ERROR 0x57
91
+ #define LDAP_USER_CANCELLED 0x58
92
+ #define LDAP_PARAM_ERROR 0x59
93
+ #define LDAP_NO_MEMORY 0x5a
94
+ #define LDAP_CONNECT_ERROR 0x5b
95
+ #define LDAP_NOT_SUPPORTED 0x5c
96
+ #define LDAP_CONTROL_NOT_FOUND 0x5d
97
+ #define LDAP_NO_RESULTS_RETURNED 0x5e
98
+ #define LDAP_MORE_RESULTS_TO_RETURN 0x5f
99
+ #define LDAP_CLIENT_LOOP 0x60
100
+ #define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61
101
+
102
+ #define LDAP_MOD_ADD 0x00
103
+ #define LDAP_MOD_DELETE 0x01
104
+ #define LDAP_MOD_REPLACE 0x02
105
+ #define LDAP_MOD_BVALUES 0x80
106
+
107
+ #define LDAP_AUTH_NONE 0x00
108
+ #define LDAP_AUTH_SIMPLE 0x80
109
+ #define LDAP_AUTH_SASL 0x83
110
+ #define LDAP_AUTH_OTHERKIND 0x86
111
+
112
+ #define LDAP_AUTH_DPA 0x2000 /* or LDAP_AUTH_OTHERKIND */
113
+ #define LDAP_AUTH_MSN 0x0800 /* or LDAP_AUTH_OTHERKIND */
114
+ #define LDAP_AUTH_NEGOTIATE 0x0400 /* or LDAP_AUTH_OTHERKIND */
115
+ #define LDAP_AUTH_NTLM 0x01000 /* or LDAP_AUTH_OTHERKIND */
116
+ #define LDAP_AUTH_SICILY 0x0200 /* or LDAP_AUTH_OTHERKIND */
117
+ #define LDAP_AUTH_SSPI LDAP_AUTH_NEGOTIATE
118
+
119
+ #define LDAP_OPT_ON ((void*)1)
120
+ #define LDAP_OPT_OFF ((void*)0)
121
+
122
+ #define LDAP_OPT_API_INFO 0x00
123
+ #define LDAP_OPT_DESC 0x01
124
+ #define LDAP_OPT_DEREF 0x02
125
+ #define LDAP_OPT_SIZELIMIT 0x03
126
+ #define LDAP_OPT_TIMELIMIT 0x04
127
+ #define LDAP_OPT_THREAD_FN_PTRS 0x05
128
+ #define LDAP_OPT_REBIND_FN 0x06
129
+ #define LDAP_OPT_REBIND_ARG 0x07
130
+ #define LDAP_OPT_REFERRALS 0x08
131
+ #define LDAP_OPT_RESTART 0x09
132
+ #define LDAP_OPT_SSL 0x0a
133
+ #define LDAP_OPT_IO_FN_PTRS 0x0b
134
+ #define LDAP_OPT_CACHE_FN_PTRS 0x0d
135
+ #define LDAP_OPT_CACHE_STRATEGY 0x0e
136
+ #define LDAP_OPT_CACHE_ENABLE 0x0f
137
+ #define LDAP_OPT_REFERRAL_HOP_LIMIT 0x10
138
+ #define LDAP_OPT_PROTOCOL_VERSION 0x11
139
+ #define LDAP_OPT_VERSION 0x11
140
+ #define LDAP_OPT_API_FEATURE_INFO 0x15
141
+ #define LDAP_OPT_HOST_NAME 0x30
142
+ #define LDAP_OPT_ERROR_NUMBER 0x31
143
+ #define LDAP_OPT_ERROR_STRING 0x32
144
+ #define LDAP_OPT_SERVER_ERROR 0x33
145
+ #define LDAP_OPT_SERVER_EXT_ERROR 0x34
146
+ #define LDAP_OPT_PING_KEEP_ALIVE 0x36
147
+ #define LDAP_OPT_PING_WAIT_TIME 0x37
148
+ #define LDAP_OPT_PING_LIMIT 0x38
149
+ #define LDAP_OPT_DNSDOMAIN_NAME 0x3b
150
+ #define LDAP_OPT_GETDSNAME_FLAGS 0x3d
151
+ #define LDAP_OPT_HOST_REACHABLE 0x3e
152
+ #define LDAP_OPT_PROMPT_CREDENTIALS 0x3f
153
+ #define LDAP_OPT_TCP_KEEPALIVE 0x40
154
+ #define LDAP_OPT_REFERRAL_CALLBACK 0x70
155
+ #define LDAP_OPT_CLIENT_CERTIFICATE 0x80
156
+ #define LDAP_OPT_SERVER_CERTIFICATE 0x81
157
+ #define LDAP_OPT_AUTO_RECONNECT 0x91
158
+ #define LDAP_OPT_SSPI_FLAGS 0x92
159
+ #define LDAP_OPT_SSL_INFO 0x93
160
+ #define LDAP_OPT_REF_DEREF_CONN_PER_MSG 0x94
161
+ #define LDAP_OPT_SIGN 0x95
162
+ #define LDAP_OPT_ENCRYPT 0x95
163
+ #define LDAP_OPT_SASL_METHOD 0x97
164
+ #define LDAP_OPT_AREC_EXCLUSIVE 0x98
165
+ #define LDAP_OPT_SECURITY_CONTEXT 0x99
166
+ #define LDAP_OPT_ROOTDSE_CACHE 0x9a
167
+
168
+ #define LDAP_DEREF_SEARCHING 0x01
169
+ #define LDAP_DEREF_FINDING 0x02
170
+ #define LDAP_DEREF_ALWAYS 0x03
171
+
172
+ /*
173
+ The flags for LDAP_OPT_GETDSNAME_FLAGS:
174
+ DS_FORCE_REDISCOVERY
175
+ DS_DIRECTORY_SERVICE_REQUIRED
176
+ DS_DIRECTORY_SERVICE_PREFERRED
177
+ DS_GC_SERVER_REQUIRED DS_PDC_REQUIRED
178
+ DS_WRITABLE_REQUIRED
179
+ DS_FDC_REQUIRED
180
+ DS_IP_REQUIRED
181
+ DS_KDC_REQUIRED
182
+ DS_TIMESERV_REQUIRED
183
+ DS_IS_FLAT_NAME
184
+ DS_IS_DNS_NAME
185
+ */
186
+
187
+
188
+ struct ldap;
189
+ typedef struct ldap LDAP, *PLDAP;
190
+
191
+ typedef struct ldapcontrol {
192
+ PCHAR ldctl_oid;
193
+ struct berval ldctl_value;
194
+ BOOLEAN ldctl_iscritical;
195
+ } LDAPControl, *PLDAPControl;
196
+
197
+ struct ldapmsg;
198
+ typedef struct ldapmsg LDAPMessage, *PLDAPMessage;
199
+
200
+
201
+ typedef struct ldapmod {
202
+ ULONG mod_op;
203
+ PCHAR mod_type;
204
+ union
205
+ {
206
+ PCHAR* modv_strvals;
207
+ struct berval** modv_bvals;
208
+ }mod_vals;
209
+ } LDAPMod, *PLDAPMod;
210
+
211
+ typedef struct ldapsortkey {
212
+ PCHAR sk_attrtype;
213
+ PCHAR sk_matchruleoid;
214
+ BOOLEAN sk_reverseorder;
215
+ } LDAPSortKey, *PLDAPSortKey;
216
+
217
+ /*
218
+ typedef struct LdapReferralCallback {
219
+ ULONG SizeOfCallbacks;
220
+ QUERYFORCONNECTION* QueryForConnection;
221
+ NOTIFYOFNEWCONNECTION* NotifyRoutine;
222
+ DEREFERENCECONNECTION* DereferenceRoutine;
223
+ } LDAP_REFERRAL_CALLBACK, *PLDAP_REFERRAL_CALLBACK;
224
+ */
225
+
226
+ struct ldapsearch;
227
+ typedef struct ldapsearch LDAPSearch, *PLDAPSearch;
228
+
229
+ #if defined(HAVE_SYS_TIME_H)
230
+ # include <sys/time.h>
231
+ #endif
232
+ typedef struct timeval LDAP_TIMEVAL;
233
+ typedef struct timeval *PLDAP_TIMEVAL;
234
+
235
+ typedef struct ldapvlvinfo {
236
+ int ldvlv_version;
237
+ unsigned long ldvlv_before_count;
238
+ unsigned long ldvlv_after_count;
239
+ unsigned long ldvlv_offset;
240
+ unsigned long ldvlv_count;
241
+ struct berval* ldvlv_attrvalue;
242
+ struct berval* ldvlv_context;
243
+ void* ldvlv_extradata;
244
+ } LDAPVLVInfo;
245
+
246
+ typedef struct ldap_apifeature_info {
247
+ int ldapaif_info_version;
248
+ char* ldapaif_name;
249
+ int ldapaif_verion;
250
+ } LDAPAPIFeatureInfo;
251
+
252
+ typedef struct ldapapiinfo {
253
+ int ldapai_info_version;
254
+ int ldapai_api_version;
255
+ int ldapai_protocol_version;
256
+ char** ldapai_extensions;
257
+ char* ldapai_vendor_name;
258
+ int ldapai_vendor_version;
259
+ } LDAPAPIInfo;
260
+
261
+ ULONG ldap_abandon(LDAP *ld, ULONG msgid);
262
+ ULONG ldap_abandon_ext(LDAP *ld, ULONG msgid,
263
+ LDAPControl **sctls, LDAPControl **cctls);
264
+ LDAP* ldap_init(PCHAR host, ULONG port);
265
+ LDAP* ldap_sslinit(PCHAR host, ULONG port, int secure);
266
+ LDAP* ldap_open(PCHAR host, ULONG port);
267
+ ULONG ldap_bind_s(LDAP *ld, PCHAR who, PCHAR cred, ULONG authmethod);
268
+ ULONG ldap_unbind_s(LDAP *ld);
269
+ ULONG ldap_simple_bind_s(LDAP *ld, PCHAR dn, PCHAR passwd);
270
+ ULONG ldap_add_s(LDAP *ld, PCHAR dn, LDAPMod *attrs[]);
271
+ ULONG ldap_add_ext_s(LDAP *ld, PCHAR dn, LDAPMod *attrs[],
272
+ LDAPControl **sctls, LDAPControl **cctls);
273
+ ULONG ldap_compare_s(LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value);
274
+ ULONG ldap_compare_ext_s(LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value,
275
+ struct berval *data, LDAPControl **sctls,
276
+ LDAPControl **cctls);
277
+ ULONG ldap_count_entries(LDAP *ld, LDAPMessage *res);
278
+ ULONG ldap_count_values(PCHAR *vals);
279
+ ULONG ldap_delete_s(LDAP *ld, PCHAR dn);
280
+ ULONG ldap_delete_ext_s(LDAP *ld, PCHAR dn,
281
+ LDAPControl **sctls, LDAPControl **cctls);
282
+ ULONG ldap_modify_s(LDAP *ld, PCHAR dn, LDAPMod *mods[]);
283
+ ULONG ldap_modify_ext_s(LDAP *ld, PCHAR dn, LDAPMod *mods[],
284
+ LDAPControl **sctls, LDAPControl **cctls);
285
+ ULONG ldap_modrdn_s(LDAP *ld, PCHAR olddn, PCHAR newdn);
286
+ ULONG ldap_modrdn2_s(LDAP *ld, PCHAR olddn, PCHAR newdn, int delold_flag);
287
+ ULONG ldap_search_s(LDAP *ld, PCHAR base, ULONG scope, PCHAR filter,
288
+ PCHAR attrs[], ULONG attrsonly, LDAPMessage **res);
289
+ ULONG ldap_search_ext_s(LDAP *ld, PCHAR base, ULONG scope, PCHAR filter,
290
+ PCHAR attrs[], ULONG attrsonly,
291
+ LDAPControl **sctls, LDAPControl **cctls,
292
+ struct timeval *timeout, ULONG sizelimit,
293
+ LDAPMessage **res);
294
+ ULONG ldap_search_st(LDAP *ld, PCHAR base, ULONG scope, PCHAR filter,
295
+ PCHAR attrs[], ULONG attrsonly,
296
+ struct timeval *timeout, LDAPMessage **res);
297
+
298
+ void ldap_perror(LDAP *ld, PCHAR msg);
299
+ PCHAR ldap_err2string(ULONG err);
300
+
301
+ ULONG ldap_msgfree(LDAPMessage *msg);
302
+ void ldap_memfree(PCHAR ptr);
303
+ void ldap_value_free(PCHAR *ptr);
304
+ void ldap_value_free_len(struct berval **vals);
305
+
306
+ PCHAR ldap_dn2ufn(PCHAR dn);
307
+ ULONG ldap_ufn2dn(PCHAR ufn, PCHAR *dn);
308
+
309
+ PCHAR ldap_first_attribute(LDAP *ld, LDAPMessage *entry, BerElement **ptr);
310
+ PCHAR ldap_next_attribute(LDAP *ld, LDAPMessage *entry, BerElement *ptr);
311
+
312
+ LDAPMessage *ldap_first_entry(LDAP *ld, LDAPMessage *res);
313
+ LDAPMessage *ldap_next_entry(LDAP *ld, LDAPMessage *entry);
314
+
315
+ PCHAR ldap_get_dn(LDAP *ld, LDAPMessage *entry);
316
+ PCHAR ldap_get_values(LDAP *ld, LDAPMessage *entry, PCHAR attr);
317
+ struct berval **ldap_get_values_len(LDAP *ld, LDAPMessage *msg, PCHAR attr);
318
+
319
+ ULONG ldap_get_option(LDAP *ld, int option, void *outval);
320
+ ULONG ldap_set_option(LDAP *ld, int option, void *inval);
321
+
322
+ ULONG ldap_connect(LDAP* ld, PLDAP_TIMEVAL *timeout);
323
+
324
+ #endif /* WINLDAP_H */
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-ldap
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.9
5
+ platform: ruby
6
+ authors:
7
+ - Alexey Chebotar
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-06-11 00:00:00 +03:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: |
17
+ It provides the interface to some LDAP libraries (e.g. OpenLDAP, Netscape SDK and Active Directory). The common API for application development is described in RFC1823 and is supported by Ruby/LDAP.
18
+
19
+ email: alexey.chebotar@gmail.com
20
+ executables: []
21
+
22
+ extensions:
23
+ - extconf.rb
24
+ extra_rdoc_files: []
25
+
26
+ files:
27
+ - ChangeLog
28
+ - COPYING
29
+ - FAQ
30
+ - NOTES
31
+ - README
32
+ - TODO
33
+ - lib/ldap/ldif.rb
34
+ - lib/ldap/schema.rb
35
+ - lib/ldap/control.rb
36
+ - test/conf.rb
37
+ - test/compare.rb
38
+ - test/tc_search.rb
39
+ - test/add.rb
40
+ - test/ext.rb
41
+ - test/tc_conn.rb
42
+ - test/delete.rb
43
+ - test/add2.rb
44
+ - test/add3.rb
45
+ - test/modrdn.rb
46
+ - test/misc1.rb
47
+ - test/misc2.rb
48
+ - test/bind-ssl.rb
49
+ - test/tc_ldif.rb
50
+ - test/search.rb
51
+ - test/subschema.rb
52
+ - test/search2.rb
53
+ - test/search3.rb
54
+ - test/setup.rb
55
+ - test/bind.rb
56
+ - test/ts_ldap.rb
57
+ - test/tc_schema.rb
58
+ - test/bind-ldaps.rb
59
+ - test/bind-sasl.rb
60
+ - extconf.rb
61
+ - win/winlber.h
62
+ - win/winldap.h
63
+ - rbldap.h
64
+ - mod.c
65
+ - entry.c
66
+ - saslconn.c
67
+ - conn.c
68
+ - ldap.c
69
+ - sslconn.c
70
+ - misc.c
71
+ has_rdoc: true
72
+ homepage: http://ruby-ldap.sourceforge.net/
73
+ licenses: []
74
+
75
+ post_install_message:
76
+ rdoc_options: []
77
+
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ version:
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: "0"
91
+ version:
92
+ requirements: []
93
+
94
+ rubyforge_project: ruby-ldap
95
+ rubygems_version: 1.3.3
96
+ signing_key:
97
+ specification_version: 3
98
+ summary: Ruby/LDAP is an extension module for Ruby
99
+ test_files: []
100
+