-
Notifications
You must be signed in to change notification settings - Fork 135
feat(ldap.dn): Add support for different formats in ldap.dn2str() via flags
#466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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