Visitar URL original
feat(ldapobject): add asynchronous whoami() extended operation by spaceone · Pull Request #680 · python-ldap/python-ldap · GitHub
Skip to content

feat(ldapobject): add asynchronous whoami() extended operation - #680

Open
spaceone wants to merge 2 commits into
mainfrom
feat/asynchronous-whoami
Open

spaceone wants to merge 2 commits into
mainfrom
feat/asynchronous-whoami

Conversation

@spaceone

Copy link
Copy Markdown
Contributor

Introduce asynchronous LDAPObject.whoami() for "Who am I?" extended operation.

Comment thread Doc/reference/ldap.rst Resolved
@spaceone spaceone added this to the 3.5.0 milestone Oct 25, 2026
Comment thread Lib/ldap/extop/whoami.py Outdated
self.dn = None
raw = value.decode('UTF-8') if value is not None else None
if raw and raw.startswith('dn:'):
self.dn = raw[3:]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.dn = raw[3:]
self.dn = raw.removeprefix('dn:')

RFC4532/4513 say this field is either missing, present but empty or an authzid where that is only:

  • u: userid (maybe we store it in self.userid?)
  • dn: dnAuthzId

Are there servers that violate this and return something else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know if it's case-insensitive?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also added a self.userid.
I would say self.dn is preferable over self.authz_id_dn.

@spaceone
spaceone force-pushed the feat/asynchronous-whoami branch from c5985bc to e3e6782 Compare November 5, 2026 11:30
Introduce asynchronous `LDAPObject.whoami()` for "Who am I?" extended operation.
@spaceone
spaceone force-pushed the feat/asynchronous-whoami branch from e3e6782 to 6a35048 Compare November 5, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants