ldaptic 0.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.
Files changed (40) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +104 -0
  3. data/Rakefile +41 -0
  4. data/lib/ldaptic.rb +151 -0
  5. data/lib/ldaptic/active_model.rb +37 -0
  6. data/lib/ldaptic/adapters.rb +90 -0
  7. data/lib/ldaptic/adapters/abstract_adapter.rb +123 -0
  8. data/lib/ldaptic/adapters/active_directory_adapter.rb +78 -0
  9. data/lib/ldaptic/adapters/active_directory_ext.rb +12 -0
  10. data/lib/ldaptic/adapters/ldap_conn_adapter.rb +262 -0
  11. data/lib/ldaptic/adapters/net_ldap_adapter.rb +173 -0
  12. data/lib/ldaptic/adapters/net_ldap_ext.rb +24 -0
  13. data/lib/ldaptic/attribute_set.rb +283 -0
  14. data/lib/ldaptic/dn.rb +365 -0
  15. data/lib/ldaptic/entry.rb +646 -0
  16. data/lib/ldaptic/error_set.rb +34 -0
  17. data/lib/ldaptic/errors.rb +136 -0
  18. data/lib/ldaptic/escape.rb +110 -0
  19. data/lib/ldaptic/filter.rb +282 -0
  20. data/lib/ldaptic/methods.rb +387 -0
  21. data/lib/ldaptic/railtie.rb +9 -0
  22. data/lib/ldaptic/schema.rb +246 -0
  23. data/lib/ldaptic/syntaxes.rb +319 -0
  24. data/test/core.schema +582 -0
  25. data/test/ldaptic_active_model_test.rb +40 -0
  26. data/test/ldaptic_adapters_test.rb +35 -0
  27. data/test/ldaptic_attribute_set_test.rb +57 -0
  28. data/test/ldaptic_dn_test.rb +110 -0
  29. data/test/ldaptic_entry_test.rb +22 -0
  30. data/test/ldaptic_errors_test.rb +23 -0
  31. data/test/ldaptic_escape_test.rb +47 -0
  32. data/test/ldaptic_filter_test.rb +53 -0
  33. data/test/ldaptic_hierarchy_test.rb +90 -0
  34. data/test/ldaptic_schema_test.rb +44 -0
  35. data/test/ldaptic_syntaxes_test.rb +66 -0
  36. data/test/mock_adapter.rb +47 -0
  37. data/test/rbslapd1.rb +111 -0
  38. data/test/rbslapd4.rb +172 -0
  39. data/test/test_helper.rb +2 -0
  40. metadata +146 -0
@@ -0,0 +1,319 @@
1
+ require 'ldaptic/schema'
2
+ require 'ldaptic/errors'
3
+
4
+ module Ldaptic
5
+
6
+ # RFC2252. Second column is "Human Readable"
7
+ syntax_string = <<-EOF
8
+ ACI Item N 1.3.6.1.4.1.1466.115.121.1.1
9
+ Access Point Y 1.3.6.1.4.1.1466.115.121.1.2
10
+ Attribute Type Description Y 1.3.6.1.4.1.1466.115.121.1.3
11
+ Audio N 1.3.6.1.4.1.1466.115.121.1.4
12
+ Binary N 1.3.6.1.4.1.1466.115.121.1.5
13
+ Bit String Y 1.3.6.1.4.1.1466.115.121.1.6
14
+ Boolean Y 1.3.6.1.4.1.1466.115.121.1.7
15
+ Certificate N 1.3.6.1.4.1.1466.115.121.1.8
16
+ Certificate List N 1.3.6.1.4.1.1466.115.121.1.9
17
+ Certificate Pair N 1.3.6.1.4.1.1466.115.121.1.10
18
+ Country String Y 1.3.6.1.4.1.1466.115.121.1.11
19
+ DN Y 1.3.6.1.4.1.1466.115.121.1.12
20
+ Data Quality Syntax Y 1.3.6.1.4.1.1466.115.121.1.13
21
+ Delivery Method Y 1.3.6.1.4.1.1466.115.121.1.14
22
+ Directory String Y 1.3.6.1.4.1.1466.115.121.1.15
23
+ DIT Content Rule Description Y 1.3.6.1.4.1.1466.115.121.1.16
24
+ DIT Structure Rule Description Y 1.3.6.1.4.1.1466.115.121.1.17
25
+ DL Submit Permission Y 1.3.6.1.4.1.1466.115.121.1.18
26
+ DSA Quality Syntax Y 1.3.6.1.4.1.1466.115.121.1.19
27
+ DSE Type Y 1.3.6.1.4.1.1466.115.121.1.20
28
+ Enhanced Guide Y 1.3.6.1.4.1.1466.115.121.1.21
29
+ Facsimile Telephone Number Y 1.3.6.1.4.1.1466.115.121.1.22
30
+ Fax N 1.3.6.1.4.1.1466.115.121.1.23
31
+ Generalized Time Y 1.3.6.1.4.1.1466.115.121.1.24
32
+ Guide Y 1.3.6.1.4.1.1466.115.121.1.25
33
+ IA5 String Y 1.3.6.1.4.1.1466.115.121.1.26
34
+ INTEGER Y 1.3.6.1.4.1.1466.115.121.1.27
35
+ JPEG N 1.3.6.1.4.1.1466.115.121.1.28
36
+ LDAP Syntax Description Y 1.3.6.1.4.1.1466.115.121.1.54
37
+ LDAP Schema Definition Y 1.3.6.1.4.1.1466.115.121.1.56
38
+ LDAP Schema Description Y 1.3.6.1.4.1.1466.115.121.1.57
39
+ Master And Shadow Access Points Y 1.3.6.1.4.1.1466.115.121.1.29
40
+ Matching Rule Description Y 1.3.6.1.4.1.1466.115.121.1.30
41
+ Matching Rule Use Description Y 1.3.6.1.4.1.1466.115.121.1.31
42
+ Mail Preference Y 1.3.6.1.4.1.1466.115.121.1.32
43
+ MHS OR Address Y 1.3.6.1.4.1.1466.115.121.1.33
44
+ Modify Rights Y 1.3.6.1.4.1.1466.115.121.1.55
45
+ Name And Optional UID Y 1.3.6.1.4.1.1466.115.121.1.34
46
+ Name Form Description Y 1.3.6.1.4.1.1466.115.121.1.35
47
+ Numeric String Y 1.3.6.1.4.1.1466.115.121.1.36
48
+ Object Class Description Y 1.3.6.1.4.1.1466.115.121.1.37
49
+ Octet String Y 1.3.6.1.4.1.1466.115.121.1.40
50
+ OID Y 1.3.6.1.4.1.1466.115.121.1.38
51
+ Other Mailbox Y 1.3.6.1.4.1.1466.115.121.1.39
52
+ Postal Address Y 1.3.6.1.4.1.1466.115.121.1.41
53
+ Protocol Information Y 1.3.6.1.4.1.1466.115.121.1.42
54
+ Presentation Address Y 1.3.6.1.4.1.1466.115.121.1.43
55
+ Printable String Y 1.3.6.1.4.1.1466.115.121.1.44
56
+ Substring Assertion Y 1.3.6.1.4.1.1466.115.121.1.58
57
+ Subtree Specification Y 1.3.6.1.4.1.1466.115.121.1.45
58
+ Supplier Information Y 1.3.6.1.4.1.1466.115.121.1.46
59
+ Supplier Or Consumer Y 1.3.6.1.4.1.1466.115.121.1.47
60
+ Supplier And Consumer Y 1.3.6.1.4.1.1466.115.121.1.48
61
+ Supported Algorithm N 1.3.6.1.4.1.1466.115.121.1.49
62
+ Telephone Number Y 1.3.6.1.4.1.1466.115.121.1.50
63
+ Teletex Terminal Identifier Y 1.3.6.1.4.1.1466.115.121.1.51
64
+ Telex Number Y 1.3.6.1.4.1.1466.115.121.1.52
65
+ UTC Time Y 1.3.6.1.4.1.1466.115.121.1.53
66
+ EOF
67
+
68
+ SYNTAXES = {} unless defined? SYNTAXES
69
+ syntax_string.each_line do |line|
70
+ d, h, oid = line.chomp.match(/(.*?)\s+([YN]) (.*)/).to_a[1..-1]
71
+ hash = {:desc => d}
72
+ if h == "N"
73
+ hash[:x_not_human_readable] = "TRUE"
74
+ end
75
+ syntax = Ldaptic::Schema::LdapSyntax.allocate
76
+ syntax.instance_variable_set(:@oid, oid)
77
+ syntax.instance_variable_set(:@attributes, hash)
78
+ SYNTAXES[oid] = syntax
79
+ end
80
+
81
+ # The classes nestled here are responsible for casting attributes to and from
82
+ # the appropriate type. End users generally need not interact with these
83
+ # directly.
84
+ module Syntaxes
85
+ # Returns the class for a given syntax name. Falls back to
86
+ # OctetString if there is not a more specific handler.
87
+ # Ldaptic::Syntaxes.for("Generalized Time")
88
+ # #=> Ldaptic::Syntaxes::GeneralizedTime
89
+ def self.for(string)
90
+ string = string.delete(' ')
91
+ if const_defined?(string)
92
+ const_get(string)
93
+ else
94
+ OctetString
95
+ end
96
+ end
97
+
98
+ class Abstract
99
+ # The +object+ argument refers back to the LDAP entry from which the
100
+ # attribute in question came. This is currently used only for the DN
101
+ # syntax, to allow <tt>dn.find</tt> to work.
102
+ def initialize(object = nil)
103
+ @object = object
104
+ end
105
+
106
+ # RFC2522 Allows single but not double quotes, and slapd implements the
107
+ # opposite of that. We'll allow both for now.
108
+ PRINTABLE = "A-Za-z0-9'\"()+,./:? =-"
109
+ def printable?(string)
110
+ string =~ /\A[#{PRINTABLE}]+\z/
111
+ end
112
+
113
+ def format(value)
114
+ Ldaptic.encode(value.kind_of?(Symbol) ? value.to_s : value)
115
+ end
116
+
117
+ def error(value)
118
+ end
119
+
120
+ def self.format(object)
121
+ new.format(object)
122
+ end
123
+
124
+ def self.parse(string)
125
+ new.parse(string)
126
+ end
127
+
128
+ end
129
+
130
+ class BitString < Abstract
131
+ def error(string)
132
+ "is invalid" unless string =~ /\A'[01]*'B\z/
133
+ end
134
+ end
135
+
136
+ class Boolean < Abstract
137
+
138
+ def parse(string)
139
+ string == "TRUE"
140
+ end
141
+
142
+ def error(string)
143
+ "must be a boolean" unless %w(TRUE FALSE).include?(string)
144
+ end
145
+
146
+ end
147
+
148
+ class DirectoryString < Abstract
149
+
150
+ def parse(string)
151
+ string
152
+ end
153
+
154
+ def error(string)
155
+ "can't be blank" if string.empty?
156
+ end
157
+
158
+ end
159
+
160
+ class PostalAddress < DirectoryString
161
+
162
+ def error(string)
163
+ if string.gsub(/\\[\\$]/, '').include?('\\')
164
+ "contains an invalid escape"
165
+ else
166
+ super
167
+ end
168
+ end
169
+ end
170
+
171
+ class DN < Abstract
172
+
173
+ def parse(string)
174
+ ::Ldaptic::DN(string, @object).freeze
175
+ end
176
+
177
+ end
178
+
179
+ # LDAP timestamps look like <tt>YYYYmmddHHMMSS.uuuuuuZ</tt>.
180
+ class GeneralizedTime < Abstract
181
+
182
+ PATTERN = /\A\d{14}(?:\.\d{1,6})?Z\z/
183
+
184
+ def parse(string)
185
+ require 'time'
186
+ parseable = string.sub(/(\.\d+)?(\w)$/, '\\2')
187
+ Time.parse(parseable) + $1.to_f
188
+ rescue ArgumentError
189
+ begin
190
+ require 'date'
191
+ DateTime.parse(parseable) + $1.to_f
192
+ rescue ArgumentError
193
+ Time.now
194
+ end
195
+ end
196
+
197
+ def error(string)
198
+ 'must be a time' unless string =~ PATTERN
199
+ end
200
+
201
+ def format(value)
202
+ require 'time'
203
+ if value.respond_to?(:to_str) && value !~ PATTERN && !Date._parse(value).empty?
204
+ super(Time.parse(value))
205
+ else
206
+ super
207
+ end
208
+ end
209
+
210
+ end
211
+
212
+ class IA5String < Abstract
213
+ PATTERN = /\A[\x00-\x7f]*\z/
214
+
215
+ def parse(string)
216
+ string
217
+ end
218
+
219
+ def error(string)
220
+ 'contains invalid characters' unless string =~ PATTERN
221
+ end
222
+
223
+ end
224
+
225
+ class OtherMailbox < IA5String
226
+ end
227
+
228
+ class INTEGER < Abstract
229
+
230
+ def parse(string)
231
+ string.to_i
232
+ end
233
+
234
+ def error(string)
235
+ "must be an integer" unless string =~ /\A\d+\z/
236
+ end
237
+
238
+ end
239
+
240
+ class LDAPSyntaxDescription < Abstract
241
+
242
+ def parse(string)
243
+ Ldaptic::Schema::LdapSyntax.new(string)
244
+ end
245
+
246
+ end
247
+
248
+ class OctetString < Abstract
249
+
250
+ def parse(string)
251
+ string
252
+ end
253
+
254
+ end
255
+
256
+
257
+ class PrintableString < Abstract
258
+
259
+ def parse(string)
260
+ string
261
+ end
262
+
263
+ def error(string)
264
+ return "can't be blank" if string.empty?
265
+ 'contains invalid characters' unless printable?(string)
266
+ end
267
+ end
268
+
269
+ class CountryString < PrintableString
270
+ def error(string)
271
+ 'must be two letters' unless printable?(string) && string =~ /\A..\z/
272
+ end
273
+ end
274
+
275
+ class DeliveryMethod < PrintableString
276
+ VALUES = %w(any mhs physical telex teletex g3fax g4fax ia5 videotex telephone)
277
+ def error(string)
278
+ 'is invalid' unless VALUES.include?(string)
279
+ end
280
+ end
281
+
282
+ class TelephoneNumber < PrintableString
283
+ end
284
+
285
+ class FacsimileTelephoneNumber < TelephoneNumber
286
+ def error(string)
287
+ return "can't be blank" if string.empty?
288
+ unless string =~ /\A[#{PRINTABLE}][$#{PRINTABLE}]*\z/
289
+ 'contains invalid characters'
290
+ end
291
+ end
292
+ end
293
+
294
+ class TelexNumber < FacsimileTelephoneNumber
295
+ end
296
+
297
+ %w(ObjectClass AttributeType MatchingRule MatchingRuleUse DITContentRule DITStructureRule NameForm).each do |syntax|
298
+ class_eval(<<-EOS, __FILE__, __LINE__.succ)
299
+ class #{syntax}Description < Abstract
300
+ def parse(string)
301
+ Ldaptic::Schema::#{syntax}.new(string)
302
+ end
303
+ end
304
+ EOS
305
+ end
306
+
307
+ end
308
+
309
+ # Microsoft junk.
310
+ {
311
+ "1.2.840.113556.1.4.906" => "1.3.6.1.4.1.1466.115.121.1.27",
312
+ "1.2.840.113556.1.4.907" => "1.3.6.1.4.1.1466.115.121.1.5"
313
+ }.each do |k, v|
314
+ SYNTAXES[k] = SYNTAXES[v]
315
+ end
316
+
317
+ end
318
+
319
+
data/test/core.schema ADDED
@@ -0,0 +1,582 @@
1
+ # OpenLDAP Core schema
2
+ # $OpenLDAP: pkg/ldap/servers/slapd/schema/core.schema,v 1.68.2.6 2005/01/20 17:01:18 kurt Exp $
3
+ ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
+ ##
5
+ ## Copyright 1998-2005 The OpenLDAP Foundation.
6
+ ## All rights reserved.
7
+ ##
8
+ ## Redistribution and use in source and binary forms, with or without
9
+ ## modification, are permitted only as authorized by the OpenLDAP
10
+ ## Public License.
11
+ ##
12
+ ## A copy of this license is available in the file LICENSE in the
13
+ ## top-level directory of the distribution or, alternatively, at
14
+ ## <http://www.OpenLDAP.org/license.html>.
15
+ #
16
+ ## Portions Copyright (C) The Internet Society (1997-2003).
17
+ ## All Rights Reserved.
18
+ ##
19
+ ## This document and translations of it may be copied and furnished to
20
+ ## others, and derivative works that comment on or otherwise explain it
21
+ ## or assist in its implementation may be prepared, copied, published
22
+ ## and distributed, in whole or in part, without restriction of any
23
+ ## kind, provided that the above copyright notice and this paragraph are
24
+ ## included on all such copies and derivative works. However, this
25
+ ## document itself may not be modified in any way, such as by removing
26
+ ## the copyright notice or references to the Internet Society or other
27
+ ## Internet organizations, except as needed for the purpose of
28
+ ## developing Internet standards in which case the procedures for
29
+ ## copyrights defined in the Internet Standards process must be
30
+ ## followed, or as required to translate it into languages other than
31
+ ## English.
32
+ ##
33
+ ## The limited permissions granted above are perpetual and will not be
34
+ ## revoked by the Internet Society or its successors or assigns.
35
+ ##
36
+ ## This document and the information contained herein is provided on an
37
+ ## "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
38
+ ## TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
39
+ ## BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
40
+ ## HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
41
+ ## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
42
+
43
+ #
44
+ #
45
+ # Includes LDAPv3 schema items from:
46
+ # RFC 2252/2256 (LDAPv3)
47
+ #
48
+ # Select standard track schema items:
49
+ # RFC 1274 (uid/dc)
50
+ # RFC 2079 (URI)
51
+ # RFC 2247 (dc/dcObject)
52
+ # RFC 2587 (PKI)
53
+ # RFC 2589 (Dynamic Directory Services)
54
+ #
55
+ # Select informational schema items:
56
+ # RFC 2377 (uidObject)
57
+
58
+ #
59
+ # Standard attribute types from RFC 2256
60
+ #
61
+
62
+ # system schema
63
+ #attributetype ( 2.5.4.0 NAME 'objectClass'
64
+ # DESC 'RFC2256: object classes of the entity'
65
+ # EQUALITY objectIdentifierMatch
66
+ # SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )
67
+
68
+ # system schema
69
+ #attributetype ( 2.5.4.1 NAME ( 'aliasedObjectName' 'aliasedEntryName' )
70
+ # DESC 'RFC2256: name of aliased object'
71
+ # EQUALITY distinguishedNameMatch
72
+ # SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
73
+
74
+ attributetype ( 2.5.4.2 NAME 'knowledgeInformation'
75
+ DESC 'RFC2256: knowledge information'
76
+ EQUALITY caseIgnoreMatch
77
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
78
+
79
+ # system schema
80
+ #attributetype ( 2.5.4.3 NAME ( 'cn' 'commonName' )
81
+ # DESC 'RFC2256: common name(s) for which the entity is known by'
82
+ # SUP name )
83
+
84
+ attributetype ( 2.5.4.4 NAME ( 'sn' 'surname' )
85
+ DESC 'RFC2256: last (family) name(s) for which the entity is known by'
86
+ SUP name )
87
+
88
+ attributetype ( 2.5.4.5 NAME 'serialNumber'
89
+ DESC 'RFC2256: serial number of the entity'
90
+ EQUALITY caseIgnoreMatch
91
+ SUBSTR caseIgnoreSubstringsMatch
92
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} )
93
+
94
+ attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' )
95
+ DESC 'RFC2256: ISO-3166 country 2-letter code'
96
+ EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch
97
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.11
98
+ SINGLE-VALUE )
99
+
100
+ attributetype ( 2.5.4.7 NAME ( 'l' 'localityName' )
101
+ DESC 'RFC2256: locality which this object resides in'
102
+ SUP name )
103
+
104
+ attributetype ( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' )
105
+ DESC 'RFC2256: state or province which this object resides in'
106
+ SUP name )
107
+
108
+ attributetype ( 2.5.4.9 NAME ( 'street' 'streetAddress' )
109
+ DESC 'RFC2256: street address of this object'
110
+ EQUALITY caseIgnoreMatch
111
+ SUBSTR caseIgnoreSubstringsMatch
112
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
113
+
114
+ attributetype ( 2.5.4.10 NAME ( 'o' 'organizationName' )
115
+ DESC 'RFC2256: organization this object belongs to'
116
+ SUP name )
117
+
118
+ attributetype ( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' )
119
+ DESC 'RFC2256: organizational unit this object belongs to'
120
+ SUP name )
121
+
122
+ attributetype ( 2.5.4.12 NAME 'title'
123
+ DESC 'RFC2256: title associated with the entity'
124
+ SUP name )
125
+
126
+ attributetype ( 2.5.4.13 NAME 'description'
127
+ DESC 'RFC2256: descriptive information'
128
+ EQUALITY caseIgnoreMatch
129
+ SUBSTR caseIgnoreSubstringsMatch
130
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
131
+
132
+ # Obsoleted by enhancedSearchGuide
133
+ attributetype ( 2.5.4.14 NAME 'searchGuide'
134
+ DESC 'RFC2256: search guide, obsoleted by enhancedSearchGuide'
135
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )
136
+
137
+ attributetype ( 2.5.4.15 NAME 'businessCategory'
138
+ DESC 'RFC2256: business category'
139
+ EQUALITY caseIgnoreMatch
140
+ SUBSTR caseIgnoreSubstringsMatch
141
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
142
+
143
+ attributetype ( 2.5.4.16 NAME 'postalAddress'
144
+ DESC 'RFC2256: postal address'
145
+ EQUALITY caseIgnoreListMatch
146
+ SUBSTR caseIgnoreListSubstringsMatch
147
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
148
+
149
+ attributetype ( 2.5.4.17 NAME 'postalCode'
150
+ DESC 'RFC2256: postal code'
151
+ EQUALITY caseIgnoreMatch
152
+ SUBSTR caseIgnoreSubstringsMatch
153
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )
154
+
155
+ attributetype ( 2.5.4.18 NAME 'postOfficeBox'
156
+ DESC 'RFC2256: Post Office Box'
157
+ EQUALITY caseIgnoreMatch
158
+ SUBSTR caseIgnoreSubstringsMatch
159
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )
160
+
161
+ attributetype ( 2.5.4.19 NAME 'physicalDeliveryOfficeName'
162
+ DESC 'RFC2256: Physical Delivery Office Name'
163
+ EQUALITY caseIgnoreMatch
164
+ SUBSTR caseIgnoreSubstringsMatch
165
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
166
+
167
+ attributetype ( 2.5.4.20 NAME 'telephoneNumber'
168
+ DESC 'RFC2256: Telephone Number'
169
+ EQUALITY telephoneNumberMatch
170
+ SUBSTR telephoneNumberSubstringsMatch
171
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )
172
+
173
+ attributetype ( 2.5.4.21 NAME 'telexNumber'
174
+ DESC 'RFC2256: Telex Number'
175
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.52 )
176
+
177
+ attributetype ( 2.5.4.22 NAME 'teletexTerminalIdentifier'
178
+ DESC 'RFC2256: Teletex Terminal Identifier'
179
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.51 )
180
+
181
+ attributetype ( 2.5.4.23 NAME ( 'facsimileTelephoneNumber' 'fax' )
182
+ DESC 'RFC2256: Facsimile (Fax) Telephone Number'
183
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.22 )
184
+
185
+ attributetype ( 2.5.4.24 NAME 'x121Address'
186
+ DESC 'RFC2256: X.121 Address'
187
+ EQUALITY numericStringMatch
188
+ SUBSTR numericStringSubstringsMatch
189
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{15} )
190
+
191
+ attributetype ( 2.5.4.25 NAME 'internationaliSDNNumber'
192
+ DESC 'RFC2256: international ISDN number'
193
+ EQUALITY numericStringMatch
194
+ SUBSTR numericStringSubstringsMatch
195
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{16} )
196
+
197
+ attributetype ( 2.5.4.26 NAME 'registeredAddress'
198
+ DESC 'RFC2256: registered postal address'
199
+ SUP postalAddress
200
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
201
+
202
+ attributetype ( 2.5.4.27 NAME 'destinationIndicator'
203
+ DESC 'RFC2256: destination indicator'
204
+ EQUALITY caseIgnoreMatch
205
+ SUBSTR caseIgnoreSubstringsMatch
206
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{128} )
207
+
208
+ attributetype ( 2.5.4.28 NAME 'preferredDeliveryMethod'
209
+ DESC 'RFC2256: preferred delivery method'
210
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.14
211
+ SINGLE-VALUE )
212
+
213
+ attributetype ( 2.5.4.29 NAME 'presentationAddress'
214
+ DESC 'RFC2256: presentation address'
215
+ EQUALITY presentationAddressMatch
216
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.43
217
+ SINGLE-VALUE )
218
+
219
+ attributetype ( 2.5.4.30 NAME 'supportedApplicationContext'
220
+ DESC 'RFC2256: supported application context'
221
+ EQUALITY objectIdentifierMatch
222
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )
223
+
224
+ attributetype ( 2.5.4.31 NAME 'member'
225
+ DESC 'RFC2256: member of a group'
226
+ SUP distinguishedName )
227
+
228
+ attributetype ( 2.5.4.32 NAME 'owner'
229
+ DESC 'RFC2256: owner (of the object)'
230
+ SUP distinguishedName )
231
+
232
+ attributetype ( 2.5.4.33 NAME 'roleOccupant'
233
+ DESC 'RFC2256: occupant of role'
234
+ SUP distinguishedName )
235
+
236
+ attributetype ( 2.5.4.34 NAME 'seeAlso'
237
+ DESC 'RFC2256: DN of related object'
238
+ SUP distinguishedName )
239
+
240
+ # system schema
241
+ #attributetype ( 2.5.4.35 NAME 'userPassword'
242
+ # DESC 'RFC2256/2307: password of user'
243
+ # EQUALITY octetStringMatch
244
+ # SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )
245
+
246
+ # Must be transferred using ;binary
247
+ # with certificateExactMatch rule (per X.509)
248
+ attributetype ( 2.5.4.36 NAME 'userCertificate'
249
+ DESC 'RFC2256: X.509 user certificate, use ;binary'
250
+ EQUALITY certificateExactMatch
251
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )
252
+
253
+ # Must be transferred using ;binary
254
+ # with certificateExactMatch rule (per X.509)
255
+ attributetype ( 2.5.4.37 NAME 'cACertificate'
256
+ DESC 'RFC2256: X.509 CA certificate, use ;binary'
257
+ EQUALITY certificateExactMatch
258
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )
259
+
260
+ # Must be transferred using ;binary
261
+ attributetype ( 2.5.4.38 NAME 'authorityRevocationList'
262
+ DESC 'RFC2256: X.509 authority revocation list, use ;binary'
263
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
264
+
265
+ # Must be transferred using ;binary
266
+ attributetype ( 2.5.4.39 NAME 'certificateRevocationList'
267
+ DESC 'RFC2256: X.509 certificate revocation list, use ;binary'
268
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
269
+
270
+ # Must be stored and requested in the binary form
271
+ attributetype ( 2.5.4.40 NAME 'crossCertificatePair'
272
+ DESC 'RFC2256: X.509 cross certificate pair, use ;binary'
273
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.10 )
274
+
275
+ # 2.5.4.41 is defined above as it's used for subtyping
276
+ #attributetype ( 2.5.4.41 NAME 'name'
277
+ # EQUALITY caseIgnoreMatch
278
+ # SUBSTR caseIgnoreSubstringsMatch
279
+ # SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
280
+
281
+ attributetype ( 2.5.4.42 NAME ( 'givenName' 'gn' )
282
+ DESC 'RFC2256: first name(s) for which the entity is known by'
283
+ SUP name )
284
+
285
+ attributetype ( 2.5.4.43 NAME 'initials'
286
+ DESC 'RFC2256: initials of some or all of names, but not the surname(s).'
287
+ SUP name )
288
+
289
+ attributetype ( 2.5.4.44 NAME 'generationQualifier'
290
+ DESC 'RFC2256: name qualifier indicating a generation'
291
+ SUP name )
292
+
293
+ attributetype ( 2.5.4.45 NAME 'x500UniqueIdentifier'
294
+ DESC 'RFC2256: X.500 unique identifier'
295
+ EQUALITY bitStringMatch
296
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )
297
+
298
+ attributetype ( 2.5.4.46 NAME 'dnQualifier'
299
+ DESC 'RFC2256: DN qualifier'
300
+ EQUALITY caseIgnoreMatch
301
+ ORDERING caseIgnoreOrderingMatch
302
+ SUBSTR caseIgnoreSubstringsMatch
303
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 )
304
+
305
+ attributetype ( 2.5.4.47 NAME 'enhancedSearchGuide'
306
+ DESC 'RFC2256: enhanced search guide'
307
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.21 )
308
+
309
+ attributetype ( 2.5.4.48 NAME 'protocolInformation'
310
+ DESC 'RFC2256: protocol information'
311
+ EQUALITY protocolInformationMatch
312
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.42 )
313
+
314
+ # 2.5.4.49 is defined above as it's used for subtyping
315
+ #attributetype ( 2.5.4.49 NAME 'distinguishedName'
316
+ # EQUALITY distinguishedNameMatch
317
+ # SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
318
+
319
+ attributetype ( 2.5.4.50 NAME 'uniqueMember'
320
+ DESC 'RFC2256: unique member of a group'
321
+ EQUALITY uniqueMemberMatch
322
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )
323
+
324
+ attributetype ( 2.5.4.51 NAME 'houseIdentifier'
325
+ DESC 'RFC2256: house identifier'
326
+ EQUALITY caseIgnoreMatch
327
+ SUBSTR caseIgnoreSubstringsMatch
328
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
329
+
330
+ # Must be transferred using ;binary
331
+ attributetype ( 2.5.4.52 NAME 'supportedAlgorithms'
332
+ DESC 'RFC2256: supported algorithms'
333
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.49 )
334
+
335
+ # Must be transferred using ;binary
336
+ attributetype ( 2.5.4.53 NAME 'deltaRevocationList'
337
+ DESC 'RFC2256: delta revocation list; use ;binary'
338
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
339
+
340
+ attributetype ( 2.5.4.54 NAME 'dmdName'
341
+ DESC 'RFC2256: name of DMD'
342
+ SUP name )
343
+
344
+
345
+ # Standard object classes from RFC2256
346
+
347
+ # system schema
348
+ #objectclass ( 2.5.6.1 NAME 'alias'
349
+ # DESC 'RFC2256: an alias'
350
+ # SUP top STRUCTURAL
351
+ # MUST aliasedObjectName )
352
+
353
+ objectclass ( 2.5.6.2 NAME 'country'
354
+ DESC 'RFC2256: a country'
355
+ SUP top STRUCTURAL
356
+ MUST c
357
+ MAY ( searchGuide $ description ) )
358
+
359
+ objectclass ( 2.5.6.3 NAME 'locality'
360
+ DESC 'RFC2256: a locality'
361
+ SUP top STRUCTURAL
362
+ MAY ( street $ seeAlso $ searchGuide $ st $ l $ description ) )
363
+
364
+ objectclass ( 2.5.6.4 NAME 'organization'
365
+ DESC 'RFC2256: an organization'
366
+ SUP top STRUCTURAL
367
+ MUST o
368
+ MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
369
+ x121Address $ registeredAddress $ destinationIndicator $
370
+ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
371
+ telephoneNumber $ internationaliSDNNumber $
372
+ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
373
+ postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )
374
+
375
+ objectclass ( 2.5.6.5 NAME 'organizationalUnit'
376
+ DESC 'RFC2256: an organizational unit'
377
+ SUP top STRUCTURAL
378
+ MUST ou
379
+ MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
380
+ x121Address $ registeredAddress $ destinationIndicator $
381
+ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
382
+ telephoneNumber $ internationaliSDNNumber $
383
+ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
384
+ postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )
385
+
386
+ objectclass ( 2.5.6.6 NAME 'person'
387
+ DESC 'RFC2256: a person'
388
+ SUP top STRUCTURAL
389
+ MUST ( sn $ cn )
390
+ MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )
391
+
392
+ objectclass ( 2.5.6.7 NAME 'organizationalPerson'
393
+ DESC 'RFC2256: an organizational person'
394
+ SUP person STRUCTURAL
395
+ MAY ( title $ x121Address $ registeredAddress $ destinationIndicator $
396
+ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
397
+ telephoneNumber $ internationaliSDNNumber $
398
+ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
399
+ postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l ) )
400
+
401
+ objectclass ( 2.5.6.8 NAME 'organizationalRole'
402
+ DESC 'RFC2256: an organizational role'
403
+ SUP top STRUCTURAL
404
+ MUST cn
405
+ MAY ( x121Address $ registeredAddress $ destinationIndicator $
406
+ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
407
+ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $
408
+ seeAlso $ roleOccupant $ preferredDeliveryMethod $ street $
409
+ postOfficeBox $ postalCode $ postalAddress $
410
+ physicalDeliveryOfficeName $ ou $ st $ l $ description ) )
411
+
412
+ objectclass ( 2.5.6.9 NAME 'groupOfNames'
413
+ DESC 'RFC2256: a group of names (DNs)'
414
+ SUP top STRUCTURAL
415
+ MUST ( member $ cn )
416
+ MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
417
+
418
+ objectclass ( 2.5.6.10 NAME 'residentialPerson'
419
+ DESC 'RFC2256: an residential person'
420
+ SUP person STRUCTURAL
421
+ MUST l
422
+ MAY ( businessCategory $ x121Address $ registeredAddress $
423
+ destinationIndicator $ preferredDeliveryMethod $ telexNumber $
424
+ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $
425
+ facsimileTelephoneNumber $ preferredDeliveryMethod $ street $
426
+ postOfficeBox $ postalCode $ postalAddress $
427
+ physicalDeliveryOfficeName $ st $ l ) )
428
+
429
+ objectclass ( 2.5.6.11 NAME 'applicationProcess'
430
+ DESC 'RFC2256: an application process'
431
+ SUP top STRUCTURAL
432
+ MUST cn
433
+ MAY ( seeAlso $ ou $ l $ description ) )
434
+
435
+ objectclass ( 2.5.6.12 NAME 'applicationEntity'
436
+ DESC 'RFC2256: an application entity'
437
+ SUP top STRUCTURAL
438
+ MUST ( presentationAddress $ cn )
439
+ MAY ( supportedApplicationContext $ seeAlso $ ou $ o $ l $
440
+ description ) )
441
+
442
+ objectclass ( 2.5.6.13 NAME 'dSA'
443
+ DESC 'RFC2256: a directory system agent (a server)'
444
+ SUP applicationEntity STRUCTURAL
445
+ MAY knowledgeInformation )
446
+
447
+ objectclass ( 2.5.6.14 NAME 'device'
448
+ DESC 'RFC2256: a device'
449
+ SUP top STRUCTURAL
450
+ MUST cn
451
+ MAY ( serialNumber $ seeAlso $ owner $ ou $ o $ l $ description ) )
452
+
453
+ objectclass ( 2.5.6.15 NAME 'strongAuthenticationUser'
454
+ DESC 'RFC2256: a strong authentication user'
455
+ SUP top AUXILIARY
456
+ MUST userCertificate )
457
+
458
+ objectclass ( 2.5.6.16 NAME 'certificationAuthority'
459
+ DESC 'RFC2256: a certificate authority'
460
+ SUP top AUXILIARY
461
+ MUST ( authorityRevocationList $ certificateRevocationList $
462
+ cACertificate ) MAY crossCertificatePair )
463
+
464
+ objectclass ( 2.5.6.17 NAME 'groupOfUniqueNames'
465
+ DESC 'RFC2256: a group of unique names (DN and Unique Identifier)'
466
+ SUP top STRUCTURAL
467
+ MUST ( uniqueMember $ cn )
468
+ MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
469
+
470
+ objectclass ( 2.5.6.18 NAME 'userSecurityInformation'
471
+ DESC 'RFC2256: a user security information'
472
+ SUP top AUXILIARY
473
+ MAY ( supportedAlgorithms ) )
474
+
475
+ objectclass ( 2.5.6.16.2 NAME 'certificationAuthority-V2'
476
+ SUP certificationAuthority
477
+ AUXILIARY MAY ( deltaRevocationList ) )
478
+
479
+ objectclass ( 2.5.6.19 NAME 'cRLDistributionPoint'
480
+ SUP top STRUCTURAL
481
+ MUST ( cn )
482
+ MAY ( certificateRevocationList $ authorityRevocationList $
483
+ deltaRevocationList ) )
484
+
485
+ objectclass ( 2.5.6.20 NAME 'dmd'
486
+ SUP top STRUCTURAL
487
+ MUST ( dmdName )
488
+ MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
489
+ x121Address $ registeredAddress $ destinationIndicator $
490
+ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
491
+ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $
492
+ street $ postOfficeBox $ postalCode $ postalAddress $
493
+ physicalDeliveryOfficeName $ st $ l $ description ) )
494
+
495
+ #
496
+ # Object Classes from RFC 2587
497
+ #
498
+ objectclass ( 2.5.6.21 NAME 'pkiUser'
499
+ DESC 'RFC2587: a PKI user'
500
+ SUP top AUXILIARY
501
+ MAY userCertificate )
502
+
503
+ objectclass ( 2.5.6.22 NAME 'pkiCA'
504
+ DESC 'RFC2587: PKI certificate authority'
505
+ SUP top AUXILIARY
506
+ MAY ( authorityRevocationList $ certificateRevocationList $
507
+ cACertificate $ crossCertificatePair ) )
508
+
509
+ objectclass ( 2.5.6.23 NAME 'deltaCRL'
510
+ DESC 'RFC2587: PKI user'
511
+ SUP top AUXILIARY
512
+ MAY deltaRevocationList )
513
+
514
+ #
515
+ # Standard Track URI label schema from RFC 2079
516
+ # system schema
517
+ #attributetype ( 1.3.6.1.4.1.250.1.57 NAME 'labeledURI'
518
+ # DESC 'RFC2079: Uniform Resource Identifier with optional label'
519
+ # EQUALITY caseExactMatch
520
+ # SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
521
+
522
+ objectclass ( 1.3.6.1.4.1.250.3.15 NAME 'labeledURIObject'
523
+ DESC 'RFC2079: object that contains the URI attribute type'
524
+ SUP top AUXILIARY
525
+ MAY labeledURI )
526
+
527
+ #
528
+ # Derived from RFC 1274, but with new "short names"
529
+ #
530
+ attributetype ( 0.9.2342.19200300.100.1.1
531
+ NAME ( 'uid' 'userid' )
532
+ DESC 'RFC1274: user identifier'
533
+ EQUALITY caseIgnoreMatch
534
+ SUBSTR caseIgnoreSubstringsMatch
535
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
536
+
537
+ attributetype ( 0.9.2342.19200300.100.1.3
538
+ NAME ( 'mail' 'rfc822Mailbox' )
539
+ DESC 'RFC1274: RFC822 Mailbox'
540
+ EQUALITY caseIgnoreIA5Match
541
+ SUBSTR caseIgnoreIA5SubstringsMatch
542
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
543
+
544
+ objectclass ( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject'
545
+ DESC 'RFC1274: simple security object'
546
+ SUP top AUXILIARY
547
+ MUST userPassword )
548
+
549
+ # RFC 1274 + RFC 2247
550
+ attributetype ( 0.9.2342.19200300.100.1.25
551
+ NAME ( 'dc' 'domainComponent' )
552
+ DESC 'RFC1274/2247: domain component'
553
+ EQUALITY caseIgnoreIA5Match
554
+ SUBSTR caseIgnoreIA5SubstringsMatch
555
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
556
+
557
+ # RFC 2247
558
+ objectclass ( 1.3.6.1.4.1.1466.344 NAME 'dcObject'
559
+ DESC 'RFC2247: domain component object'
560
+ SUP top AUXILIARY MUST dc )
561
+
562
+ # RFC 2377
563
+ objectclass ( 1.3.6.1.1.3.1 NAME 'uidObject'
564
+ DESC 'RFC2377: uid object'
565
+ SUP top AUXILIARY MUST uid )
566
+
567
+ # From COSINE Pilot
568
+ attributetype ( 0.9.2342.19200300.100.1.37
569
+ NAME 'associatedDomain'
570
+ DESC 'RFC1274: domain associated with object'
571
+ EQUALITY caseIgnoreIA5Match
572
+ SUBSTR caseIgnoreIA5SubstringsMatch
573
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
574
+
575
+ # RFC 2459 -- deprecated in favor of 'mail' (in cosine.schema)
576
+ attributetype ( 1.2.840.113549.1.9.1
577
+ NAME ( 'email' 'emailAddress' 'pkcs9email' )
578
+ DESC 'RFC2459: legacy attribute for email addresses in DNs'
579
+ EQUALITY caseIgnoreIA5Match
580
+ SUBSTR caseIgnoreIA5SubstringsMatch
581
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )
582
+