Skip to content

fix: retirement PII leaks by redacting pending secondary email/name data#38427

Merged
robrap merged 8 commits into
openedx:masterfrom
ktyagiapphelix2u:ktyagi/secondaryemail
Jun 9, 2026
Merged

fix: retirement PII leaks by redacting pending secondary email/name data#38427
robrap merged 8 commits into
openedx:masterfrom
ktyagiapphelix2u:ktyagi/secondaryemail

Conversation

@ktyagiapphelix2u

@ktyagiapphelix2u ktyagiapphelix2u commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates user retirement and secondary email cleanup flows to redact sensitive secondary email data before deletion.

Changes

Added redaction + delete flow for PendingSecondaryEmailChange
Updated AccountRecovery.retire_recovery_email to redact before delete
Integrated cleanup into retirement/deactivation flows and management commands
Added tests verifying UPDATE occurs before DELETE

Ticket & Reference

https://2u-internal.atlassian.net/browse/BOMS-499

@ktyagiapphelix2u ktyagiapphelix2u marked this pull request as ready for review April 23, 2026 11:29
@ktyagiapphelix2u ktyagiapphelix2u requested a review from a team as a code owner April 23, 2026 11:29

@robrap robrap left a comment

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.

Thanks. Some comments to get started...

Comment thread common/djangoapps/student/models/user.py
Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread common/djangoapps/student/models/user.py
Comment thread openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py Outdated
Comment thread common/djangoapps/student/views/management.py Outdated
Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/views.py Outdated
Comment thread common/djangoapps/student/tests/test_models.py Outdated
Comment thread openedx/core/djangoapps/user_api/management/tests/test_retire_user.py Outdated

@robrap robrap left a comment

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.

@ktyagiapphelix2u: I added some top-level comments before starting this review. Please respond to those as well. Thank you.

Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread common/djangoapps/student/models/user.py
Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread common/djangoapps/student/models/user.py Outdated
@ktyagiapphelix2u ktyagiapphelix2u force-pushed the ktyagi/secondaryemail branch from 84d0cf9 to 6320d0b Compare May 12, 2026 11:07
@ktyagiapphelix2u ktyagiapphelix2u force-pushed the ktyagi/secondaryemail branch from db74adc to a14e9a1 Compare June 2, 2026 08:17
@ktyagiapphelix2u ktyagiapphelix2u force-pushed the ktyagi/secondaryemail branch from a14e9a1 to d7a28df Compare June 2, 2026 09:40
Comment thread common/djangoapps/student/models/user.py
Comment thread common/djangoapps/student/models/user.py
Comment thread common/djangoapps/student/models/user.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/utils.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/views.py
Comment thread openedx/core/djangoapps/user_api/accounts/utils.py Outdated
Comment thread openedx/core/djangoapps/user_api/management/commands/retire_user.py Outdated
@ktyagiapphelix2u ktyagiapphelix2u force-pushed the ktyagi/secondaryemail branch from f214c6c to a2ce50a Compare June 3, 2026 06:25
@ktyagiapphelix2u ktyagiapphelix2u force-pushed the ktyagi/secondaryemail branch from d1687f6 to 11561c4 Compare June 3, 2026 07:18

@robrap robrap left a comment

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.

Can you fix the pylint issues and then we can merge? Thanks.

Comment thread openedx/core/djangoapps/user_api/management/tests/test_retire_user.py Outdated
Comment thread openedx/core/djangoapps/user_api/management/tests/test_retire_user.py Outdated
Comment thread openedx/core/djangoapps/user_api/accounts/utils.py Outdated

@robrap robrap left a comment

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.

Great. Thank you!

@robrap robrap merged commit 6107849 into openedx:master Jun 9, 2026
42 checks passed
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.

5 participants