From: Ingo S. <st...@un...> - 2005-02-23 06:41:40
|
Am Dienstag, 22. Februar 2005 09:57 schrieb Michael Str=F6der: > Deepak Giridharagopal wrote: > > My approach has been to model the OpenLDAP LDAPControl struct as a > > tuple: > > > > (OID <string>, Criticality Flag <boolean>, Value <string/list of bytes>) > > I'd prefer to have a dedicated class hierachy for this in a separate > sub-module ldap.controls. I will provide something for it which is > compatible with your modifications to LDAPObject.c. > > > The "Value" field needs to be an ASN.1 encoded list of bytes. > > [..] > > # Here's where I actually construct the payload. The payload for this > > # AD control needs to be an ASN.1 sequence with a single int inside. > > payload =3D asn1.Sequence() > > payload.append(0xf) > > > > # Ta da, here is the control > > control =3D ( oid, criticality, payload.encode() ) > > I think we could move the invocation of .encode() for all controls in a > list into the wrapper classldap.ldapobject.LDAPObject. Together with a > well-defined control class possible type conflicts would clash early in > the Python wrapper code. This makes debugging easier. This is prepared in our implementation, we would see the BerVal (or "payloa= d")=20 as python-class which internaly saves types and values which should be used= =20 for encoding. But I don't expect that we will implement this in the near=20 future... Regards Ingo > Ciao, Michael. > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev =2D-=20 Ingo Steuwer st...@un... fon: +49 421 22 232- 0 Entwicklung Linux for Your Business Univention GmbH http://www.univention.de/ fax: +49 421 22 232-99 |