-
Notifications
You must be signed in to change notification settings - Fork 126
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
base: main
Are you sure you want to change the base?
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. |
Lib/ldap/dn.py
Outdated
#if not dn: | ||
# return '' |
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.
required?
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.
libldap isn't too sure either, but allows it: https://git.openldap.org/openldap/openldap/-/blob/OPENLDAP_REL_ENG_2_6_3/libraries/libldap/getdn.c#L3021-3028
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.
Unless we want to make the distinction for None
and make dn2str(None) is None
, might be too much hassle though.
ldap.dn2str()
ldap.dn2str()
via flags
…` 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
Performance comparison: C:
Python:
|
In C
dn2str()
supportsflags
which 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