Skip to content

Commit e08cc74

Browse files
AAP-43543 fixing another missing lower that was causing origional use… (#718)
…rs to be created ## Description <!-- Mandatory: Provide a clear, concise description of the changes and their purpose --> - What is being changed? ATF testing found an additional area where the username needed to be lower cased. - Why is this change needed? A second user with the original case was still being created (but unused). - How does this change address the issue? This mitigates that second call which had the original cased username. ## Type of Change <!-- Mandatory: Check one or more boxes that apply --> - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Test update - [ ] Refactoring (no functional changes) - [ ] Development environment change - [ ] Configuration change ## Self-Review Checklist <!-- These items help ensure quality - they complement our automated CI checks --> - [X] I have performed a self-review of my code - [X] I have added relevant comments to complex code sections - [X] I have updated documentation where needed - [X] I have considered the security impact of these changes - [X] I have considered performance implications - [X] I have thought about error handling and edge cases - [X] I have tested the changes in my local environment ## Testing Instructions <!-- Optional for test-only changes. Mandatory for all other changes --> <!-- Must be detailed enough for reviewers to reproduce --> ### Prerequisites <!-- List any specific setup required --> ### Steps to Test 1. Log in as a lowercase user, note the lower case user is created. 2. Log in as a mixed cased user, note you are logged in as the lower case user. 3. Log out and login as admin. 4. Load the users page and note the presence of both the lower case and mixed case users. ### Expected Results <!-- Describe what should happen after following the steps --> ## Additional Context <!-- Optional but helpful information --> ### Required Actions <!-- Check if changes require work in other areas --> <!-- Remove section if no external actions needed --> - [ ] Requires documentation updates <!-- API docs, feature docs, deployment guides --> - [ ] Requires downstream repository changes <!-- Specify repos: django-ansible-base, eda-server, etc. --> - [ ] Requires infrastructure/deployment changes <!-- CI/CD, installer updates, new services --> - [ ] Requires coordination with other teams <!-- UI team, platform services, infrastructure --> - [ ] Blocked by PR/MR: #XXX <!-- Reference blocking PRs/MRs with brief context --> ### Screenshots/Logs <!-- Add if relevant to demonstrate the changes -->
1 parent 5da2594 commit e08cc74

File tree

1 file changed

+1
-1
lines changed
  • ansible_base/authentication/authenticator_plugins

1 file changed

+1
-1
lines changed

ansible_base/authentication/authenticator_plugins/ldap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def authenticate(self, request, username=None, password=None, **kwargs) -> (obje
488488
# In unit testing there were cases where the function we are in was being called before get_or_build_user.
489489
# Its unclear if that was just a byproduct of mocking or a real scenario.
490490
# Since this call is idempotent we are just going to call it again to ensure the AuthenticatorUser is created for update_user_claims
491-
get_or_create_authenticator_user(username, self.database_instance, user_details={}, extra_data=user_from_ldap.ldap_user.attrs.data)
491+
get_or_create_authenticator_user(username.lower(), self.database_instance, user_details={}, extra_data=user_from_ldap.ldap_user.attrs.data)
492492
return update_user_claims(user_from_ldap, self.database_instance, users_groups)
493493
except Exception:
494494
logger.exception(f"Encountered an error authenticating to LDAP {self.database_instance.name}")

0 commit comments

Comments
 (0)