From: Andreas H. <aha...@te...> - 2007-05-28 13:08:53
|
Hi, last Friday I played a bit with controls in python-ldap. I was trying to get the matched-values control (LDAP_CONTROL_VALUESRETURNFILTER) to work. It seems I have to manually do the BER encoding of the values. I googled for some modules and pyasn1 seems to be the most complete one, but I would have to basically write classes for the whole LDAP spec :( This mailing list had some discussion about this previously, and some other names popped up, like pysnmp and pisces. So, what are you guys using for LDAP BER encoding in python nowadays? |
From: <mi...@st...> - 2007-05-28 18:09:41
|
Andreas Hasenack wrote: > > last Friday I played a bit with controls in python-ldap. I was trying to > get the matched-values control (LDAP_CONTROL_VALUESRETURNFILTER) to > work. Feel free to contribute your results. > It seems I have to manually do the BER encoding of the values. I googled > for some modules and pyasn1 seems to be the most complete one, but I > would have to basically write classes for the whole LDAP spec :( You can use pyasn1 for just creating the BER en-/decoding the control values. Please look into Lib/ldap/controls.py to get the idea how you can implement the methods for encoding and decoding in sub-classes of ldap.controls.LDAPControl. > This mailing list had some discussion about this previously, and some > other names popped up, like pysnmp and pisces. pisces is pretty much dead although I'm still using it in web2ldap for certificate decoding. pyasn1 was extracted from pysnmp - same author. Ciao, Michael. |
From: Andreas H. <aha...@te...> - 2007-05-31 22:23:47
|
On Mon, May 28, 2007 at 08:07:09PM +0200, Michael Ströder wrote: > Andreas Hasenack wrote: > > > > last Friday I played a bit with controls in python-ldap. I was trying to > > get the matched-values control (LDAP_CONTROL_VALUESRETURNFILTER) to > > work. > > Feel free to contribute your results. > > > It seems I have to manually do the BER encoding of the values. I googled > > for some modules and pyasn1 seems to be the most complete one, but I > > would have to basically write classes for the whole LDAP spec :( > > You can use pyasn1 for just creating the BER en-/decoding the control > values. Please look into Lib/ldap/controls.py to get the idea how you > can implement the methods for encoding and decoding in sub-classes of > ldap.controls.LDAPControl. I think it worked. Luckily in my case the OpenLDAP library already has a function called ldap_put_vrFilter() which I could use to do all the encoding of a ValuesReturn filter. Using a bit of monkey see, monkey do, I have such a filter working now: mv = MatchedValuesControl(criticality=True,"(mail=*@example.com)") res = ld.search_ext_s(base, scope, filter, attrlist = ['mail'], serverctrls = [mv]) In this example, if the entry matching the filter has: mail: fo...@ex... mail: fo...@ex... The result will only have "mail: fo...@ex...". Without the control, the result would have both mail attributes. I will still see about the decode part and then post what I have. |
From: <mi...@st...> - 2007-05-31 22:53:41
|
Andreas Hasenack wrote: > > Luckily in my case the OpenLDAP library already has a > function called ldap_put_vrFilter() which I could use to do all the > encoding of a ValuesReturn filter. > [..] > I will still see about the decode part and then post what I have. Since which version of OpenLDAP is ldap_put_vrFilter() present? Ciao, Michael. |
From: Andreas H. <aha...@te...> - 2007-06-01 00:04:25
|
On Thursday 31 May 2007 19:51:08 Michael Str=F6der wrote: > Andreas Hasenack wrote: > > Luckily in my case the OpenLDAP library already has a > > function called ldap_put_vrFilter() which I could use to do all the > > encoding of a ValuesReturn filter. > > [..] > > I will still see about the decode part and then post what I have. > > Since which version of OpenLDAP is ldap_put_vrFilter() present? I don't know. I only checked /usr/include/ldap.h to make sure it's a public= =20 function and not an internal one. |
From: Chaos E. <cha...@gm...> - 2007-06-01 08:44:31
|
I have tested LDAP Server Side Sort with Novell's eDirectory 8.8.1 using BER constructor form LDAPTOR project and python-ldap's ldap interface. from my side, it works. so why not try LDAPTOR's BER constructor for your purpose? On 6/1/07, Andreas Hasenack <aha...@te...> wrote: > > On Thursday 31 May 2007 19:51:08 Michael Str=F6der wrote: > > Andreas Hasenack wrote: > > > Luckily in my case the OpenLDAP library already has a > > > function called ldap_put_vrFilter() which I could use to do all the > > > encoding of a ValuesReturn filter. > > > [..] > > > I will still see about the decode part and then post what I have. > > > > Since which version of OpenLDAP is ldap_put_vrFilter() present? > > I don't know. I only checked /usr/include/ldap.h to make sure it's a > public > function and not an internal one. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev > --=20 Best Regards Chaos Eternal |
From: Andreas H. <aha...@te...> - 2007-06-01 12:07:46
|
On Fri, Jun 01, 2007 at 04:44:32PM +0800, Chaos Eternal wrote: > I have tested LDAP Server Side Sort with Novell's eDirectory 8.8.1 using > BER constructor form LDAPTOR project and python-ldap's ldap interface. > from my side, it works. > so why not try LDAPTOR's BER constructor for your purpose? I think I would really like something like openldap's ber_printf routines. Seems fairly easy to construct these sequences with it. I don't know about LAPTOR, never heard of it before. Is it some sort of python interface to liblber? (Yes, I know, I can google it :P) |
From: Chaos E. <cha...@gm...> - 2007-06-03 11:39:51
|
Ldaptor is a pure-Python library that implements . - LDAP client logic. . - separately-accessible LDAP and BER protocol message generation/parsing. . - ASCII-format LDAP filter generation and parsing. . - LDIF format data generation. . - Samba password changing logic. . On 6/1/07, Andreas Hasenack <aha...@te...> wrote: > > On Fri, Jun 01, 2007 at 04:44:32PM +0800, Chaos Eternal wrote: > > I have tested LDAP Server Side Sort with Novell's eDirectory 8.8.1using > > BER constructor form LDAPTOR project and python-ldap's ldap interface. > > from my side, it works. > > so why not try LDAPTOR's BER constructor for your purpose? > > I think I would really like something like openldap's ber_printf > routines. Seems fairly easy to construct these sequences with it. I > don't know about LAPTOR, never heard of it before. Is it some sort of > python interface to liblber? (Yes, I know, I can google it :P) > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev > -- Best Regards Chaos Eternal |
From: Andreas H. <aha...@te...> - 2007-06-01 12:16:16
|
On Fri, Jun 01, 2007 at 12:51:08AM +0200, Michael Ströder wrote: > Andreas Hasenack wrote: > > > > Luckily in my case the OpenLDAP library already has a > > function called ldap_put_vrFilter() which I could use to do all the > > encoding of a ValuesReturn filter. > > [..] > > I will still see about the decode part and then post what I have. > > Since which version of OpenLDAP is ldap_put_vrFilter() present? Found it in the first public 2.3.x version (2.3.4) and also in late 2.2.x versions. I didn't check further back. So I guess it would be OK to use it, given that python-ldap currently requires openldap 2.3.x. |
From: Roland H. <rol...@ad...> - 2007-06-04 07:04:40
|
Chaos Eternal wrote: > Ldaptor is a pure-Python library that implements That it is, but do anyone know if it is actively maintained ? Looking at the Trac-page for the project (http://www.inoi.fi/open/trac/ldaptor) , it seems that nothing has happend with ldaptor since 2005. -- Roland |
From: <mi...@st...> - 2007-06-04 11:31:03
|
On 8:00:48 am 2007-06-04 Roland Hedberg <rol...@ad...> wrote: > Chaos Eternal wrote: > > Ldaptor is a pure-Python library that implements > > That it is, but do anyone know if it is actively maintained ? > > Looking at the Trac-page for the project > (http://www.inoi.fi/open/trac/ldaptor) , it seems that nothing has > happend with ldaptor since 2005. IIRC I've contacted the author to join forces several years ago. No response. Ciao, Michael. |
From: Chaos E. <cha...@gm...> - 2007-06-04 12:19:04
|
oops, I forget to check the activity. but from Debian's view: http://packages.qa.debian.org/l/ldaptor.html , the project's activity lasts until Oct, 2006. On 6/4/07, Roland Hedberg <rol...@ad...> wrote: > > Chaos Eternal wrote: > > Ldaptor is a pure-Python library that implements > > That it is, but do anyone know if it is actively maintained ? > > Looking at the Trac-page for the project > (http://www.inoi.fi/open/trac/ldaptor) , it seems that nothing has > happend with ldaptor since 2005. > > -- Roland > -- Best Regards Chaos Eternal |
From: <mi...@st...> - 2007-06-04 14:06:45
|
HI! Don't want to blame anybody but it seems unfeasible to determine the status of the ldaptor project. Therefore I prefer not to rely on it at all. And IIRC it's strictly GPL. python-ldap has a more liberal license. Therefore we cannot copy code from it. Ciao, Michael. On 2:19:03 pm 2007-06-04 "Chaos Eternal" <cha...@gm...> wrote: > oops, I forget to check the activity. > but from Debian's view: http://packages.qa.debian.org/l/ldaptor.html > , the project's activity lasts until Oct, 2006. > > On 6/4/07, Roland Hedberg <rol...@ad...> wrote: > > > > Chaos Eternal wrote: > > > Ldaptor is a pure-Python library that implements > > > > That it is, but do anyone know if it is actively maintained ? > > > > Looking at the Trac-page for the project > > (http://www.inoi.fi/open/trac/ldaptor) , it seems that nothing has > > happend with ldaptor since 2005. > > > > -- Roland |