Skip to content

Commit c45a7a3

Browse files
committed
[AAP-48878] Add email field to AuthenticatorUser (#754)
## Description - What is being changed? The AuthenticatorUser model is extended with the `email` field. This PR is only to add the field, which will be populated by a later ticket- https://issues.redhat.com/browse/AAP-48066. - Why is this change needed? This change is needed to associate AuthenticatorUsers directly with their email address. This will make it easier to debug issues regarding how users authenticate into the platform, since we will be able to tell directly which email address their authenticatoruser is configured with. When authenticating via multiple different authenticators, we will sign the user into the AAP account associated with their email. - How does this change address the issue? This change addresses the issue by adding the email field to the AuthenticatorUser table, which will be later populated by AAP-48066. ## Type of Change <!-- Mandatory: Check one or more boxes that apply --> - [x] New feature (non-breaking change which adds functionality) ## Self-Review Checklist <!-- These items help ensure quality - they complement our automated CI checks --> - [ ] I have performed a self-review of my code - [ ] I have added relevant comments to complex code sections - [ ] I have updated documentation where needed - [ ] I have considered the security impact of these changes - [ ] I have considered performance implications - [ ] I have thought about error handling and edge cases - [ ] 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. 2. 3. ### 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 4dd2797 commit c45a7a3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.21 on 2025-07-09 12:02
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('dab_authentication', '0017_alter_authenticator_slug'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='authenticatoruser',
15+
name='email',
16+
field=models.EmailField(blank=True, default=None, help_text='The e-mail associated with this authenticator user.', max_length=254, null=True),
17+
),
18+
]

ansible_base/authentication/models/authenticator_user.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class AuthenticatorUser(AbstractUserSocialAuth, AbstractCommonModel):
4242
on_delete=models.CASCADE,
4343
help_text=_("The local DB user related to this authenticator user."),
4444
)
45+
email = models.EmailField(default=None, null=True, blank=True, help_text=_("The e-mail associated with this authenticator user."))
4546
# TODO: set self.authenticated based on the provider that is passed to this method.
4647
# the provider should be the name of the Authenticator model instance
4748
claims = models.JSONField(

0 commit comments

Comments
 (0)