Skip to content

Commit 7c22697

Browse files
committed
Add support for X-ORIGIN in schema element class ObjectClass
1 parent ec41070 commit 7c22697

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/ldap/schema/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ class ObjectClass(SchemaElement):
137137
'AUXILIARY':None,
138138
'ABSTRACT':None,
139139
'MUST':(()),
140-
'MAY':()
140+
'MAY':(),
141+
'X-ORIGIN':(None,)
141142
}
142143

143144
def _set_attrs(self,l,d):
@@ -146,6 +147,7 @@ def _set_attrs(self,l,d):
146147
self.desc = d['DESC'][0]
147148
self.must = d['MUST']
148149
self.may = d['MAY']
150+
self.x_origin = d['X-ORIGIN'][0]
149151
# Default is STRUCTURAL, see RFC2552 or draft-ietf-ldapbis-syntaxes
150152
self.kind = 0
151153
if d['ABSTRACT']!=None:
@@ -168,6 +170,7 @@ def __str__(self):
168170
result.append({0:' STRUCTURAL',1:' ABSTRACT',2:' AUXILIARY'}[self.kind])
169171
result.append(self.key_list('MUST',self.must,sep=' $ '))
170172
result.append(self.key_list('MAY',self.may,sep=' $ '))
173+
result.append(self.key_attr('X-ORIGIN',self.x_origin,quoted=1))
171174
return '( %s )' % ''.join(result)
172175

173176

Tests/t_ldap_schema_subentry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_urlfetch_file(self):
6161
str(obj),
6262
"( 2.5.6.9 NAME 'groupOfNames' SUP top STRUCTURAL MUST cn "
6363
"MAY ( member $ businessCategory $ seeAlso $ owner $ ou $ o "
64-
"$ description ) )"
64+
"$ description ) X-ORIGIN 'RFC 4519' )"
6565
)
6666

6767

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