Open resposit opened 3 years ago
I think I just found the answer myself, using the .asText() method. Sorry about that.
Apparently I'm not yet able to use the asText() method within handleBeforeForwardRequest() due to bytes/string conversion:
The request filter I'm getting is:
x = LDAPFilter_equalityMatch(attributeDesc=BEROctetString(value=b'attribute'), assertionValue=BEROctetString(value=b'value'))
when I try x.asText() I get:
----> 1 x.asText()
/usr/local/lib/python3.6/site-packages/ldaptor/protocols/pureldap.py in asText(self) 590 + "=" 591 + self.escaper(self.assertionValue.value) --> 592 + ")" 593 )
Any ideas ?
Apparently I'm not yet able to use the asText() method within handleBeforeForwardRequest() due to bytes/string conversion:
The request filter I'm getting is:
x = LDAPFilter_equalityMatch(attributeDesc=BEROctetString(value=b'attribute'), assertionValue=BEROctetString(value=b'value'))
when I try x.asText() I get:
----> 1 x.asText()
/usr/local/lib/python3.6/site-packages/ldaptor/protocols/pureldap.py in asText(self) 590 + "=" 591 + self.escaper(self.assertionValue.value) --> 592 + ")" 593 )
Any ideas ?
Any solutions for that?
Hello, I'm trying to implement a custom LDAP proxy server that gets a searchRequest from a client, inspect the request and possibly modify the search flter before sending it to the proxied server. For example, if the client sends a searchRequest with filter '(a=b)', the proxy should modify this filter to '(&(a=b)(c=d))' and send it to the proxied server. When I override the handleBeforeForwardRequest (of the ProxyBase class), it seems the filter string has already been parsed and the request object contains a pureldap filter object which I don't quite understand how can be modified. Having a string filter would be much easier. Any suggestions ?
Thanks