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

Allow multiple Tombstone records for the same sub #421

Merged
merged 1 commit into from May 25, 2022

Conversation

alex9smith
Copy link
Member

@alex9smith alex9smith commented May 25, 2022

When this app was originally created it was the canonical place to
store account data. The Tombstone records were to allow us to count
deleted accounts and enforce uniqueness.

Now however, that's not the case. The source for account data is Auth's
OIDC provider and Tombstones are less helpful to us now this app is
only part of a relying party's account storage.

Accounts on GOV.UK are only used for email notifications, so we plan to
use email alert API's logic to delete accounts that have no subscriptions.

This means it will be possible for someone to create an account, sign up
for notifications, delete that subscription and then have that account
deleted automatically. We need to make sure that if that person comes
back to GOV.UK and signs in, we can create a new OidcUser for them
that behaves exactly as expected.

In order for that to happen, we have to be able to create multiple
Tombstones for the same sub.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

When this app was originally created it was *the* canonical place to
store account data. The Tombstone records were to allow us to count
deleted accounts and enforce uniqueness.

Now however, that's not the case. The source for account data is Auth's
OICD provider and Tombstones are less helpful to us now this app is
only part of a relying party's account storage.

Accounts on GOV.UK are only used for email notifications, so we plan to
use email alert API's logic to delete accounts that have no subscriptions.

This means it will be possible for someone to create an account, sign up
for notifications, delete that subscription and then have that account
deleted aoutmatically. We need to make sure that if that person comes
back to GOV.UK and signs in, we can create a new `OidcUser` for them
that behaves exactly as expected.

In order for that to happen, we have to be able to create multiple
Tombstones for the same sub.
alex9smith added a commit that referenced this pull request May 25, 2022
In [[1]] we allowed there to be multiple Tombstones with the same sub
as this app is no longer the canonical place for account creation and
deletion data.

Since we're no longer checking for duplicates, we can also start
deleting old records as they're now only really useful for debugging.

We went with 30 days as that matches the time needed for an account to
be marked 'inactive' by email alert API.

We do lose the ability to count the number of accounts that has ever
existed by adding this worker but, as mentioned before, this app isn't
the right place to count this anyway so it's not a real loss.

[1]: #421
@alex9smith alex9smith merged commit 54398e5 into main May 25, 2022
@alex9smith alex9smith deleted the GUA-92-non-unique-tombstone branch May 25, 2022 16:59
alex9smith added a commit that referenced this pull request May 25, 2022
In [[1]] we allowed there to be multiple Tombstones with the same sub
as this app is no longer the canonical place for account creation and
deletion data.

Since we're no longer checking for duplicates, we can also start
deleting old records as they're now only really useful for debugging.

We went with 30 days as that matches the time needed for an account to
be marked 'inactive' by email alert API.

We do lose the ability to count the number of accounts that has ever
existed by adding this worker but, as mentioned before, this app isn't
the right place to count this anyway so it's not a real loss.

[1]: #421
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.

None yet

2 participants