Skip to content

Complete verified guardian withdrawal follow-up - #83

Merged
VictoriousWealth merged 19 commits into
stagingfrom
security/guardian-withdrawal-follow-up
Nov 30, 2026
Merged

VictoriousWealth merged 19 commits into
stagingfrom
security/guardian-withdrawal-follow-up

Conversation

@VictoriousWealth

Copy link
Copy Markdown
Member

Adds verified guardian reauthorisation and permanent-deletion follow-up to the existing privacy operator workspace. The learner stays restricted while a request is pending. A verified cancellation keeps the account under the withdrawal hold.

The follow-up requires an additive database migration. The staging smoke test uses disposable accounts and the provider's simulated recipients. Production promotion remains a separate decision under the database release procedure.

Verification covers one-time email links, replacement and replay, continued restrictions, the existing cancellation window, fresh approval, and under-18 AI limits.

This update introduces a new section on deferred production checks.

It outlines the steps for restoring a recent production database backup and verifying its usability.

These checks are essential before inviting beta users and deploying database changes.
Added details about verified guardian follow-ups using the operator workspace.

Clarified the confirmation process through a one-time link and cancellation of verified guardian deletion.
This commit introduces a new API route for handling guardian follow-up actions.

It includes validation for incoming requests and rate limiting to prevent abuse.

The route supports two main steps: review and confirm, with appropriate responses for each case.
Added support for additional actions in the guardian withdrawal process.

This includes handling for CANCEL_DELETION and follows rate limit rules.

Refactored response handling for better clarity and maintainability.
…component

This component allows guardians to confirm decisions regarding learner accounts.

It handles both reauthorisation and deletion requests, providing appropriate feedback.

The component also manages API interactions and displays error messages as needed.
…page

This commit introduces a new page for the guardian withdrawal decision.

It includes metadata for SEO and imports the GuardianWithdrawalDecision component.

The page is designed to review a verified Study Buddy privacy request.
Added action selection for different withdrawal processes.

Updated error messages for clarity and improved user guidance.

Refactored result handling to accommodate new action states.
Added sections on decisions after withdrawal, including reauthorisation and permanent deletion.

Clarified the steps for handling guardian requests and account restrictions.

Updated the checklist for authorised operators regarding reauthorisation and deletion requests.
Refactor the test to ensure userUpdateMany is called correctly.

Add a new test case for handling withdrawn accounts.

This improves the coverage of account lifecycle scenarios.
Introduced a new function to calculate the permanent deletion schedule based on the confirmation date.

This change improves the clarity of the deletion timing logic and centralizes the scheduling calculation.

Additionally, refactored the deletion confirmation process to utilize this new function.
This commit introduces a new test file for the guardian withdrawal follow-up functionality.

The tests cover various scenarios including storing invitations, handling confirmed decisions, and managing deletion requests.
…counts

This update introduces functionality to send follow-up emails for accounts that have been withdrawn.

The implementation includes new imports and a function to handle the email sending process.

Error handling and logging are also included to ensure security and traceability.
This migration introduces a new table for managing guardian withdrawal follow up actions.

It includes new types for follow up actions and statuses, enhancing the event handling capabilities.

Additionally, it sets up necessary permissions for specific roles.
Introduced new enums for follow-up actions and statuses related to guardian authorizations.

Added a new model for GuardianWithdrawalFollowUp to manage follow-up processes.

These changes enhance the schema to support additional functionality for managing guardian authorizations.
This commit introduces a new route for guardian authorizations.

The new POST endpoint allows for a one-time guardian follow-up token and explicit confirmation.
This change introduces a new test for the guardian follow-up process.

It verifies that guardians can confirm access or deletion without lifting the withdrawal hold early.

The test ensures that the email links and actions are functioning as expected.
This change adds a text field to the message object being pushed to the outbox.

This enhancement improves the message structure to include plain text content, which may be necessary for certain email clients.
@railway-app

railway-app Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the study-buddy-v2-pr-83 environment in Study Buddy

Service Status Web Updated
security-operations-report ✅ Success (View Logs) Nov 30, 2026 at 3:10 am UTC
account-lifecycle-cron ✅ Success (View Logs) Nov 30, 2026 at 3:09 am UTC
2 services not affected by this PR
  • study-buddy-v2
  • clamav

@railway-app
railway-app Bot temporarily deployed to Study Buddy / study-buddy-v2-pr-83 November 30, 2026 02:57 Destroyed
Added tests to verify the behavior of account deletion cancellation.

Included checks for API responses and database updates during the deletion process.
@railway-app
railway-app Bot temporarily deployed to Study Buddy / study-buddy-v2-pr-83 November 30, 2026 02:59 Destroyed
Updated the status check for the API response to allow for both 401 and 403.

Also added a verification for the account status after guardian authorization is withdrawn.

These changes enhance the robustness of the tests related to account lifecycle management.
@railway-app
railway-app Bot temporarily deployed to Study Buddy / study-buddy-v2-pr-83 November 30, 2026 03:01 Destroyed
@VictoriousWealth
VictoriousWealth merged commit 0ae5a32 into staging Nov 30, 2026
6 checks passed

This branch was successfully deployed

No deployments
Study Buddy / study-buddy-v2-pr-83 — 274fa721 Deployed Nov 30, 2026 by railway-app[bot]
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.

1 participant