@@ -106,26 +106,32 @@ class ObjectClass(SchemaElement):
106
106
oid
107
107
OID assigned to the object class
108
108
names
109
- This list of strings contains all NAMEs of the object class
109
+ All NAMEs of the object class (tuple of strings)
110
110
desc
111
- This string contains description text (DESC) of the object class
111
+ Description text (DESC) of the object class (string, or None if missing)
112
112
obsolete
113
113
Integer flag (0 or 1) indicating whether the object class is marked
114
114
as OBSOLETE in the schema
115
115
must
116
- This list of strings contains NAMEs or OIDs of all attributes
117
- an entry of the object class must have
116
+ NAMEs or OIDs of all attributes an entry of the object class must have
117
+ (tuple of strings)
118
118
may
119
- This list of strings contains NAMEs or OIDs of additional attributes
120
- an entry of the object class may have
119
+ NAMEs or OIDs of additional attributes an entry of the object class may
120
+ have (tuple of strings)
121
121
kind
122
122
Kind of an object class:
123
123
0 = STRUCTURAL,
124
124
1 = ABSTRACT,
125
125
2 = AUXILIARY
126
126
sup
127
- This list of strings contains NAMEs or OIDs of object classes
128
- this object class is derived from
127
+ NAMEs or OIDs of object classes this object class is derived from
128
+ (tuple of strings)
129
+ x_origin
130
+ Value of the X-ORIGIN extension flag (tuple of strings)
131
+
132
+ Although it's not official, X-ORIGIN is used in several LDAP server
133
+ implementations to indicate the source of the associated schema
134
+ element
129
135
"""
130
136
schema_attribute = u'objectClasses'
131
137
token_defaults = {
@@ -137,7 +143,8 @@ class ObjectClass(SchemaElement):
137
143
'AUXILIARY' :None ,
138
144
'ABSTRACT' :None ,
139
145
'MUST' :(()),
140
- 'MAY' :()
146
+ 'MAY' :(),
147
+ 'X-ORIGIN' :()
141
148
}
142
149
143
150
def _set_attrs (self ,l ,d ):
@@ -146,6 +153,7 @@ def _set_attrs(self,l,d):
146
153
self .desc = d ['DESC' ][0 ]
147
154
self .must = d ['MUST' ]
148
155
self .may = d ['MAY' ]
156
+ self .x_origin = d ['X-ORIGIN' ]
149
157
# Default is STRUCTURAL, see RFC2552 or draft-ietf-ldapbis-syntaxes
150
158
self .kind = 0
151
159
if d ['ABSTRACT' ]!= None :
@@ -168,6 +176,7 @@ def __str__(self):
168
176
result .append ({0 :' STRUCTURAL' ,1 :' ABSTRACT' ,2 :' AUXILIARY' }[self .kind ])
169
177
result .append (self .key_list ('MUST' ,self .must ,sep = ' $ ' ))
170
178
result .append (self .key_list ('MAY' ,self .may ,sep = ' $ ' ))
179
+ result .append (self .key_list ('X-ORIGIN' ,self .x_origin ,quoted = 1 ))
171
180
return '( %s )' % '' .join (result )
172
181
173
182
@@ -190,40 +199,46 @@ class AttributeType(SchemaElement):
190
199
Class attributes:
191
200
192
201
oid
193
- OID assigned to the attribute type
202
+ OID assigned to the attribute type (string)
194
203
names
195
- This list of strings contains all NAMEs of the attribute type
204
+ All NAMEs of the attribute type (tuple of strings)
196
205
desc
197
- This string contains description text (DESC) of the attribute type
206
+ Description text (DESC) of the attribute type (string, or None if missing)
198
207
obsolete
199
208
Integer flag (0 or 1) indicating whether the attribute type is marked
200
209
as OBSOLETE in the schema
201
210
single_value
202
211
Integer flag (0 or 1) indicating whether the attribute must
203
212
have only one value
204
213
syntax
205
- String contains OID of the LDAP syntax assigned to the attribute type
214
+ OID of the LDAP syntax assigned to the attribute type
206
215
no_user_mod
207
216
Integer flag (0 or 1) indicating whether the attribute is modifiable
208
217
by a client application
209
218
equality
210
- String contains NAME or OID of the matching rule used for
211
- checking whether attribute values are equal
219
+ NAME or OID of the matching rule used for checking whether attribute values
220
+ are equal (string, or None if missing)
212
221
substr
213
- String contains NAME or OID of the matching rule used for
214
- checking whether an attribute value contains another value
222
+ NAME or OID of the matching rule used for checking whether an attribute
223
+ value contains another value (string, or None if missing)
215
224
ordering
216
- String contains NAME or OID of the matching rule used for
217
- checking whether attribute values are lesser-equal than
225
+ NAME or OID of the matching rule used for checking whether attribute values
226
+ are lesser-equal than (string, or None if missing)
218
227
usage
219
228
USAGE of an attribute type:
220
229
0 = userApplications
221
230
1 = directoryOperation,
222
231
2 = distributedOperation,
223
232
3 = dSAOperation
224
233
sup
225
- This list of strings contains NAMEs or OIDs of attribute types
226
- this attribute type is derived from
234
+ NAMEs or OIDs of attribute types this attribute type is derived from
235
+ (tuple of strings)
236
+ x_origin
237
+ Value of the X-ORIGIN extension flag (tuple of strings).
238
+
239
+ Although it's not official, X-ORIGIN is used in several LDAP server
240
+ implementations to indicate the source of the associated schema
241
+ element
227
242
"""
228
243
schema_attribute = u'attributeTypes'
229
244
token_defaults = {
@@ -239,7 +254,7 @@ class AttributeType(SchemaElement):
239
254
'COLLECTIVE' :None ,
240
255
'NO-USER-MODIFICATION' :None ,
241
256
'USAGE' :('userApplications' ,),
242
- 'X-ORIGIN' :(None , ),
257
+ 'X-ORIGIN' :(),
243
258
'X-ORDERED' :(None ,),
244
259
}
245
260
@@ -251,7 +266,7 @@ def _set_attrs(self,l,d):
251
266
self .equality = d ['EQUALITY' ][0 ]
252
267
self .ordering = d ['ORDERING' ][0 ]
253
268
self .substr = d ['SUBSTR' ][0 ]
254
- self .x_origin = d ['X-ORIGIN' ][ 0 ]
269
+ self .x_origin = d ['X-ORIGIN' ]
255
270
self .x_ordered = d ['X-ORDERED' ][0 ]
256
271
try :
257
272
syntax = d ['SYNTAX' ][0 ]
@@ -302,7 +317,7 @@ def __str__(self):
302
317
3 :" USAGE dSAOperation" ,
303
318
}[self .usage ]
304
319
)
305
- result .append (self .key_attr ('X-ORIGIN' ,self .x_origin ,quoted = 1 ))
320
+ result .append (self .key_list ('X-ORIGIN' ,self .x_origin ,quoted = 1 ))
306
321
result .append (self .key_attr ('X-ORDERED' ,self .x_ordered ,quoted = 1 ))
307
322
return '( %s )' % '' .join (result )
308
323
@@ -314,7 +329,7 @@ class LDAPSyntax(SchemaElement):
314
329
oid
315
330
OID assigned to the LDAP syntax
316
331
desc
317
- This string contains description text (DESC) of the LDAP syntax
332
+ Description text (DESC) of the LDAP syntax (string, or None if missing)
318
333
not_human_readable
319
334
Integer flag (0 or 1) indicating whether the attribute type is marked
320
335
as not human-readable (X-NOT-HUMAN-READABLE)
@@ -358,14 +373,15 @@ class MatchingRule(SchemaElement):
358
373
oid
359
374
OID assigned to the matching rule
360
375
names
361
- This list of strings contains all NAMEs of the matching rule
376
+ All NAMEs of the matching rule (tuple of strings)
362
377
desc
363
- This string contains description text (DESC) of the matching rule
378
+ Description text (DESC) of the matching rule
364
379
obsolete
365
380
Integer flag (0 or 1) indicating whether the matching rule is marked
366
381
as OBSOLETE in the schema
367
382
syntax
368
- String contains OID of the LDAP syntax this matching rule is usable with
383
+ OID of the LDAP syntax this matching rule is usable with
384
+ (string, or None if missing)
369
385
"""
370
386
schema_attribute = u'matchingRules'
371
387
token_defaults = {
@@ -403,15 +419,15 @@ class MatchingRuleUse(SchemaElement):
403
419
oid
404
420
OID of the accompanying matching rule
405
421
names
406
- This list of strings contains all NAMEs of the matching rule
422
+ All NAMEs of the matching rule (tuple of strings)
407
423
desc
408
- This string contains description text (DESC) of the matching rule
424
+ Description text (DESC) of the matching rule (string, or None if missing)
409
425
obsolete
410
426
Integer flag (0 or 1) indicating whether the matching rule is marked
411
427
as OBSOLETE in the schema
412
428
applies
413
- This list of strings contains NAMEs or OIDs of attribute types
414
- for which this matching rule is used
429
+ NAMEs or OIDs of attribute types for which this matching rule is used
430
+ (tuple of strings)
415
431
"""
416
432
schema_attribute = u'matchingRuleUse'
417
433
token_defaults = {
@@ -449,26 +465,29 @@ class DITContentRule(SchemaElement):
449
465
oid
450
466
OID of the accompanying structural object class
451
467
names
452
- This list of strings contains all NAMEs of the DIT content rule
468
+ All NAMEs of the DIT content rule (tuple of strings)
453
469
desc
454
- This string contains description text (DESC) of the DIT content rule
470
+ Description text (DESC) of the DIT content rule
471
+ (string, or None if missing)
455
472
obsolete
456
473
Integer flag (0 or 1) indicating whether the DIT content rule is marked
457
474
as OBSOLETE in the schema
458
475
aux
459
- This list of strings contains NAMEs or OIDs of all auxiliary
460
- object classes usable in an entry of the object class
476
+ NAMEs or OIDs of all auxiliary object classes usable in an entry of the
477
+ object class (tuple of strings)
461
478
must
462
- This list of strings contains NAMEs or OIDs of all attributes
463
- an entry of the object class must have which may extend the
464
- list of required attributes of the object classes of an entry
479
+ NAMEs or OIDs of all attributes an entry of the object class must
480
+ have, which may extend the list of required attributes of the object
481
+ classes of an entry.
482
+ (tuple of strings)
465
483
may
466
- This list of strings contains NAMEs or OIDs of additional attributes
467
- an entry of the object class may have which may extend the
468
- list of optional attributes of the object classes of an entry
484
+ NAMEs or OIDs of additional attributes an entry of the object class may
485
+ have. which may extend the list of optional attributes of the object
486
+ classes of an entry.
487
+ (tuple of strings)
469
488
nots
470
- This list of strings contains NAMEs or OIDs of attributes which
471
- may not be present in an entry of the object class
489
+ NAMEs or OIDs of attributes which may not be present in an entry of the
490
+ object class. (tuple of strings)
472
491
"""
473
492
schema_attribute = u'dITContentRules'
474
493
token_defaults = {
@@ -515,17 +534,18 @@ class DITStructureRule(SchemaElement):
515
534
ruleid
516
535
rule ID of the DIT structure rule (only locally unique)
517
536
names
518
- This list of strings contains all NAMEs of the DIT structure rule
537
+ All NAMEs of the DIT structure rule (tuple of strings)
519
538
desc
520
- This string contains description text (DESC) of the DIT structure rule
539
+ Description text (DESC) of the DIT structure rule
540
+ (string, or None if missing)
521
541
obsolete
522
542
Integer flag (0 or 1) indicating whether the DIT content rule is marked
523
543
as OBSOLETE in the schema
524
544
form
525
- List of strings with NAMEs or OIDs of associated name forms
545
+ NAMEs or OIDs of associated name forms (tuple of strings)
526
546
sup
527
- List of strings with NAMEs or OIDs of allowed structural object classes
528
- of superior entries in the DIT
547
+ NAMEs or OIDs of allowed structural object classes
548
+ of superior entries in the DIT (tuple of strings)
529
549
"""
530
550
schema_attribute = u'dITStructureRules'
531
551
@@ -573,23 +593,22 @@ class NameForm(SchemaElement):
573
593
oid
574
594
OID of the name form
575
595
names
576
- This list of strings contains all NAMEs of the name form
596
+ All NAMEs of the name form (tuple of strings)
577
597
desc
578
- This string contains description text (DESC) of the name form
598
+ Description text (DESC) of the name form (string, or None if missing)
579
599
obsolete
580
600
Integer flag (0 or 1) indicating whether the name form is marked
581
601
as OBSOLETE in the schema
582
602
form
583
- List of strings with NAMEs or OIDs of associated name forms
603
+ NAMEs or OIDs of associated name forms (tuple of strings)
584
604
oc
585
- String with NAME or OID of structural object classes this name form
586
- is usable with
605
+ NAME or OID of structural object classes this name form
606
+ is usable with (string)
587
607
must
588
- This list of strings contains NAMEs or OIDs of all attributes
589
- an RDN must contain
608
+ NAMEs or OIDs of all attributes an RDN must contain (tuple of strings)
590
609
may
591
- This list of strings contains NAMEs or OIDs of additional attributes
592
- an RDN may contain
610
+ NAMEs or OIDs of additional attributes an RDN may contain
611
+ (tuple of strings)
593
612
"""
594
613
schema_attribute = u'nameForms'
595
614
token_defaults = {
0 commit comments