feat(ldap.dn): Add support for different formats in ldap.dn2str() via flags#466
feat(ldap.dn): Add support for different formats in ldap.dn2str() via flags#466droideck merged 4 commits intopython-ldap:mainfrom
ldap.dn2str() via flags#466Conversation
6948a13 to
f25fa60
Compare
|
@spaceone hi! |
|
Overall, I think it'll be nice to have the feature. |
|
I agree, getting better DN handling would be nice. |
ldap.dn2str()ldap.dn2str() via flags
ebdee71 to
7c80d5c
Compare
|
Performance comparison: C: Python: |
mistotebe
left a comment
There was a problem hiding this comment.
LGTM, maybe be consistent about using raw strings (r'cn=\C3...' vs. 'cn=\\C3...')
Thanks for approval. I added a commit which unifies the whole file, to use raw-strings. |
|
@droideck maybe also a review from your side? |
droideck
left a comment
There was a problem hiding this comment.
Looks good to me!
Could you please add a couple of more tests?
For NUL handling, for huge DNs, and for invalid flags.
If not, no worries, we can improve it later.
Thank you!
I added every possible combination I can think of :-)
Okay, added multiple string lengthes.
this already existed. |
droideck
left a comment
There was a problem hiding this comment.
Looks good to me!
Please, squash the commits if you want (or confirm if you want to have it as separate commits).
|
The commits should not be squashed, they follow conventional commit specification. |
…` via flags In C `dn2str()` supports `flags` which works by providing one of `LDAP_DN_FORMAT_UFN`, `LDAP_DN_FORMAT_AD_CANONICAL`, `LDAP_DN_FORMAT_DCE`, `LDAP_DN_FORMAT_LDAPV3`. These symbols do exist in Python, but could not be used ultimately because the Python counterpart was pure Python and did not pass to `dn2str(3)`. Fix python-ldap#257
In C
dn2str()supportsflagswhich works by providingLDAP_DN_FORMAT_UFN,LDAP_DN_FORMAT_AD_CANONICAL, ….These symbols do exist in Python, but could not be used ultimately because the Python counterpart was pure Python and did not pass to
dn2str(3).Fix #257