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

One login integration migrations #10144

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CatalinVoineag
Copy link
Contributor

@CatalinVoineag CatalinVoineag commented Dec 4, 2024

Context

We want to allow our candidates to login into apply with one login. We also want to allow them to recover their account if their one login email is different from the candidate's email.

These are all the migrations we need for our one login integration, to allow a candidate to login or recover their account.

This is based on the one login spike

Changes proposed in this pull request

We need to allow the user to reclaim their account with any code valid in the last 1 hour for example. That's why AccountRecoveryRequest has_many AccountRecoveryRequestCodes

erDiagram
    Candidate ||--o{ OmniAuthLogin : has_one
    Candidate ||--o{ AccountRecoveryRequest : has_one
    Candidate {
      string email_address
      boolean recovered
      boolean dismiss_recovery
    }
    AccountRecoveryRequest ||--o{ AccountRecoveryRequestCode : has_many
    OmniAuthLogin {
      string token
      string email_address
      id candidate_id
    }
    AccountRecoveryRequest {
      string previous_account_email_address
      id candidate
    }
    AccountRecoveryRequestCode {
      string hashed_code
      id account_recovery_request_id
      datetime created_at
    }
Loading

Guidance to review

Does it make sense?

Things to check

  • If the code removes any existing feature flags, a data migration has also been added to delete the entry from the database
  • This code does not rely on migrations in the same Pull Request
  • If this code includes a migration adding or changing columns, it also backfills existing records for consistency
  • If this code adds a column to the DB, decide whether it needs to be in analytics yml file or analytics blocklist
  • If this code adds a column that may include PII, the sanitise.sql script and 0025-protecting-personal-data-in-production-dump.md ADR have been updated.
  • API release notes have been updated if necessary
  • If it adds a significant user-facing change, is it documented in the CHANGELOG?
  • Required environment variables have been updated added to the Azure KeyVault
  • Inform data insights team due to database changes
  • Make sure all information from the Trello card is in here
  • Rebased main
  • Cleaned commit history
  • Tested by running locally
  • Add PR link to Trello card

@CatalinVoineag
Copy link
Contributor Author

These are all the migrations we need for our one login integration, to
allow a candidate to login or recover their account.
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