Skip to content

Commit 7528c08

Browse files
fix: Redact SSO PII before deletion
1 parent bd3c108 commit 7528c08

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

openedx/core/djangoapps/user_api/accounts/signals.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def redact_social_auth_pii_before_deletion(sender, instance, **kwargs): # pylin
4747
# Safety-net in case the record wasn't redacted before delete.
4848
if instance.extra_data or instance.uid != redacted_uid:
4949
logger.warning(
50-
'Social auth link for user_id=%s, provider=%s was deleted without first being redacted. Redacting in pre_delete.',
50+
'Social auth link for user_id=%s, provider=%s was deleted without first being redacted.'
51+
' Redacting in pre_delete.',
5152
instance.user_id,
5253
instance.provider,
5354
)

openedx/core/djangoapps/user_api/accounts/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ def redact_and_delete_social_auth(user_id, skip_delete=False):
207207
Redact PII from all UserSocialAuth records for the given user, then delete them.
208208
209209
Redaction happens before deletion so that any observers see only sanitised data.
210+
Downstream copies of data may use soft-deletes, and redacting before deleting
211+
ensures PII for retired users (or future retirements) is not retained.
210212
The uid format matches ``get_redacted_social_auth_uid()``.
211213
212214
``skip_delete`` should only be set to True when called from the pre_delete signal

0 commit comments

Comments
 (0)