Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding new api endpoint to handle user retirement #1

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

DonatoBD
Copy link
Contributor

@DonatoBD DonatoBD commented Dec 17, 2024

Description

Since the ecommerce is deprecated and will be maintained in redwood, this PR was directly made to the NAU fork to add an API endpoint to ecommerce that performs user retirement.

For this, the endpoint /api/v2/user/retire. was added, taking advantage of the fact that the function already exists in edx-platform.

As the ecommerce did not store user profile information, this API deletes the social_auth associated with the LMS and modifies both the username and email of the user to comply with the same pattern as in LMS. In this way, the user will be considered retired, and we can compare it with the LMS data if needed to understand how it reached that state.

Regarding validation at the time of authentication, I do not consider it necessary to add a conditional that checks if the user is retired or not, since the ecommerce authentication works via SSO using the LMS and this validation already occurs for retired accounts in the LMS.

If you need to remove or change any user-related data (PII), we can add it to this API to be processed during user retirement process

Testing instructions

  1. Build an ecommerce image with the branch worked on this PR
  2. Install tutor-contrib-retirement fork with the branch worked on that PR
  3. Run a tutor local environment with ecommerce, discovery and retirement activated
  4. Declare COOL_OFF_DAYS to 0 so you can test the retirement workflow without wait 30 days (or modify the retirementstatus record directly through mysql)
  5. Register, go to account and delete you account
  6. Run tutor local retire-users to check the entire retirement workflow

Copy link
Member

@igobranco igobranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✔️

@igobranco igobranco merged commit 36336ca into nau/redwood.master Dec 26, 2024
2 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.

2 participants