Skip to content

Commit 7b76b00

Browse files
committed
Fix and reword docs of schema elements
The sequences are always tuples, not lists. String attributes are None when missing.
1 parent 2dc4ebd commit 7b76b00

File tree

1 file changed

+68
-58
lines changed

1 file changed

+68
-58
lines changed

Lib/ldap/schema/models.py

Lines changed: 68 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -106,29 +106,32 @@ class ObjectClass(SchemaElement):
106106
oid
107107
OID assigned to the object class
108108
names
109-
This list of strings contains all NAMEs of the object class
109+
All NAMEs of the object class (tuple of strings)
110110
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)
112112
obsolete
113113
Integer flag (0 or 1) indicating whether the object class is marked
114114
as OBSOLETE in the schema
115115
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)
118118
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)
121121
kind
122122
Kind of an object class:
123123
0 = STRUCTURAL,
124124
1 = ABSTRACT,
125125
2 = AUXILIARY
126126
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)
129129
x_origin
130-
This string contains the X-ORIGIN text which is typically used to indicate
131-
the source of the associated schema element. It can a list of strings
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
132135
"""
133136
schema_attribute = u'objectClasses'
134137
token_defaults = {
@@ -196,43 +199,46 @@ class AttributeType(SchemaElement):
196199
Class attributes:
197200
198201
oid
199-
OID assigned to the attribute type
202+
OID assigned to the attribute type (string)
200203
names
201-
This list of strings contains all NAMEs of the attribute type
204+
All NAMEs of the attribute type (tuple of strings)
202205
desc
203-
This string contains description text (DESC) of the attribute type
206+
Description text (DESC) of the attribute type (string, or None if missing)
204207
obsolete
205208
Integer flag (0 or 1) indicating whether the attribute type is marked
206209
as OBSOLETE in the schema
207210
single_value
208211
Integer flag (0 or 1) indicating whether the attribute must
209212
have only one value
210213
syntax
211-
String contains OID of the LDAP syntax assigned to the attribute type
214+
OID of the LDAP syntax assigned to the attribute type
212215
no_user_mod
213216
Integer flag (0 or 1) indicating whether the attribute is modifiable
214217
by a client application
215218
equality
216-
String contains NAME or OID of the matching rule used for
217-
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)
218221
substr
219-
String contains NAME or OID of the matching rule used for
220-
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)
221224
ordering
222-
String contains NAME or OID of the matching rule used for
223-
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)
224227
usage
225228
USAGE of an attribute type:
226229
0 = userApplications
227230
1 = directoryOperation,
228231
2 = distributedOperation,
229232
3 = dSAOperation
230233
sup
231-
This list of strings contains NAMEs or OIDs of attribute types
232-
this attribute type is derived from
234+
NAMEs or OIDs of attribute types this attribute type is derived from
235+
(tuple of strings)
233236
x_origin
234-
This string contains the X-ORIGIN text which is typically used to indicate
235-
the source of the associated schema element. It can a list of strings
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
236242
"""
237243
schema_attribute = u'attributeTypes'
238244
token_defaults = {
@@ -323,7 +329,7 @@ class LDAPSyntax(SchemaElement):
323329
oid
324330
OID assigned to the LDAP syntax
325331
desc
326-
This string contains description text (DESC) of the LDAP syntax
332+
Description text (DESC) of the LDAP syntax (string, or None if missing)
327333
not_human_readable
328334
Integer flag (0 or 1) indicating whether the attribute type is marked
329335
as not human-readable (X-NOT-HUMAN-READABLE)
@@ -367,14 +373,15 @@ class MatchingRule(SchemaElement):
367373
oid
368374
OID assigned to the matching rule
369375
names
370-
This list of strings contains all NAMEs of the matching rule
376+
All NAMEs of the matching rule (tuple of strings)
371377
desc
372-
This string contains description text (DESC) of the matching rule
378+
Description text (DESC) of the matching rule
373379
obsolete
374380
Integer flag (0 or 1) indicating whether the matching rule is marked
375381
as OBSOLETE in the schema
376382
syntax
377-
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)
378385
"""
379386
schema_attribute = u'matchingRules'
380387
token_defaults = {
@@ -412,15 +419,15 @@ class MatchingRuleUse(SchemaElement):
412419
oid
413420
OID of the accompanying matching rule
414421
names
415-
This list of strings contains all NAMEs of the matching rule
422+
All NAMEs of the matching rule (tuple of strings)
416423
desc
417-
This string contains description text (DESC) of the matching rule
424+
Description text (DESC) of the matching rule (string, or None if missing)
418425
obsolete
419426
Integer flag (0 or 1) indicating whether the matching rule is marked
420427
as OBSOLETE in the schema
421428
applies
422-
This list of strings contains NAMEs or OIDs of attribute types
423-
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)
424431
"""
425432
schema_attribute = u'matchingRuleUse'
426433
token_defaults = {
@@ -458,26 +465,29 @@ class DITContentRule(SchemaElement):
458465
oid
459466
OID of the accompanying structural object class
460467
names
461-
This list of strings contains all NAMEs of the DIT content rule
468+
All NAMEs of the DIT content rule (tuple of strings)
462469
desc
463-
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)
464472
obsolete
465473
Integer flag (0 or 1) indicating whether the DIT content rule is marked
466474
as OBSOLETE in the schema
467475
aux
468-
This list of strings contains NAMEs or OIDs of all auxiliary
469-
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)
470478
must
471-
This list of strings contains NAMEs or OIDs of all attributes
472-
an entry of the object class must have which may extend the
473-
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)
474483
may
475-
This list of strings contains NAMEs or OIDs of additional attributes
476-
an entry of the object class may have which may extend the
477-
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)
478488
nots
479-
This list of strings contains NAMEs or OIDs of attributes which
480-
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)
481491
"""
482492
schema_attribute = u'dITContentRules'
483493
token_defaults = {
@@ -524,17 +534,18 @@ class DITStructureRule(SchemaElement):
524534
ruleid
525535
rule ID of the DIT structure rule (only locally unique)
526536
names
527-
This list of strings contains all NAMEs of the DIT structure rule
537+
All NAMEs of the DIT structure rule (tuple of strings)
528538
desc
529-
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)
530541
obsolete
531542
Integer flag (0 or 1) indicating whether the DIT content rule is marked
532543
as OBSOLETE in the schema
533544
form
534-
List of strings with NAMEs or OIDs of associated name forms
545+
NAMEs or OIDs of associated name forms (tuple of strings)
535546
sup
536-
List of strings with NAMEs or OIDs of allowed structural object classes
537-
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)
538549
"""
539550
schema_attribute = u'dITStructureRules'
540551

@@ -582,23 +593,22 @@ class NameForm(SchemaElement):
582593
oid
583594
OID of the name form
584595
names
585-
This list of strings contains all NAMEs of the name form
596+
All NAMEs of the name form (tuple of strings)
586597
desc
587-
This string contains description text (DESC) of the name form
598+
Description text (DESC) of the name form (string, or None if missing)
588599
obsolete
589600
Integer flag (0 or 1) indicating whether the name form is marked
590601
as OBSOLETE in the schema
591602
form
592-
List of strings with NAMEs or OIDs of associated name forms
603+
NAMEs or OIDs of associated name forms (tuple of strings)
593604
oc
594-
String with NAME or OID of structural object classes this name form
595-
is usable with
605+
NAME or OID of structural object classes this name form
606+
is usable with (string)
596607
must
597-
This list of strings contains NAMEs or OIDs of all attributes
598-
an RDN must contain
608+
NAMEs or OIDs of all attributes an RDN must contain (tuple of strings)
599609
may
600-
This list of strings contains NAMEs or OIDs of additional attributes
601-
an RDN may contain
610+
NAMEs or OIDs of additional attributes an RDN may contain
611+
(tuple of strings)
602612
"""
603613
schema_attribute = u'nameForms'
604614
token_defaults = {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy