Import ldap.filter in security_manager override#68226
Merged
Merged
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
vincbeck
approved these changes
Jun 8, 2026
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
1 task
Member
|
I just hit this issue on 3.2.2. Thanks for the fix @litesh1998 and congrats on your first contribution! |
2 tasks
75 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix LDAP login failure caused by missing
ldap.filterimportcloses: #68224
When LDAP authentication is enabled, Airflow may return a 500 Internal Server Error during login.
The failure occurs in the LDAP search path where
ldap.filter.escape_filter_chars()is called without importing theldap.filtersubmodule first. With recent versions ofpython-ldap, importingldapalone does not automatically expose thefiltermodule, resulting in:This change explicitly imports
ldap.filterbefore it is used by the LDAP authentication flow.Reproduction
python-ldap(e.g. 3.4.7).Root Cause
ldap.filter.escape_filter_chars()is referenced during LDAP user lookup, but theldap.filtermodule is not imported. Recent versions ofpython-ldaprequire the submodule to be imported explicitly.Fix
Import
ldap.filterbefore usingldap.filter.escape_filter_chars().Testing
Reproduced the issue on:
Verified that LDAP authentication succeeds after the change.
Verified that the 500 Internal Server Error no longer occurs during login.