Skip to content

Commit

Permalink
Try this too.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Mar 18, 2024
1 parent e2ce3c5 commit f8c13fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ansible_base/authentication/authenticator_plugins/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def validate_ldap_filter(value: Any, with_user: bool = False) -> bool:
dn_value = value
if with_user:
if user_search_string not in value:
raise ValidationError(_(f'DN must include "{user_search_string}" placeholder for username: "{value}"'))
#raise ValidationError(_(f'DN must include "{user_search_string}" placeholder for username: "{value}"'))
raise ValidationError(_(f'DN must include "users" placeholder for username: "{value}"'))
dn_value = value.replace(user_search_string, 'USER')

if re.match(r'^\([A-Za-z0-9-]+?=[^()]+?\)$', dn_value):
Expand All @@ -123,7 +124,7 @@ def validate_ldap_filter(value: Any, with_user: bool = False) -> bool:
# We only need to check with_user at the top of the recursion stack
validate_ldap_filter(f'({sub_filter})', with_user=False)
return
raise ValidationError(_('Invalid filter: %s' % value))
raise ValidationError(_('Invalid filter: %s') % value)


def get_all_sub_classes(cls):
Expand Down

0 comments on commit f8c13fa

Please sign in to comment.