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

Add minimum_valid_iat_time to subscriber table, and hook up the rest of the fxa webhook events 🛢 #222

Merged
merged 9 commits into from
Jan 12, 2024

Conversation

MelissaAutumn
Copy link
Member

@MelissaAutumn MelissaAutumn commented Jan 9, 2024

This should fix all of the tasks in #220

This add a minimum_valid_iat_time to the Subscriber's table. This field is used to quickly block any old/logged out access tokens. Normally we'd have a self-cleaning deny list, but we don't have redis or another caching mechanism setup that would make it easy to add in. This should cover our needs for now though.

For context: iat is the issued at time for a jwt. If we set the minimum_valid_iat_time to the forced logout time it would prevent any previously valid jwt tokens from being used. If a user logs themselves out then we don't set a minimum_valid_iat_time.

I've also hooked up the delete-user event (ref: https://github.com/mozilla/fxa/blob/main/packages/fxa-event-broker/README.md) and added test for each webhook event we handle.

I also fixed a frontend oopsie I discovered while testing out primary email changes on fxa. (By adding a + to my email.)

🛢 This change requires a db migration

@MelissaAutumn MelissaAutumn requested a review from devmount January 9, 2024 17:49
@MelissaAutumn MelissaAutumn self-assigned this Jan 9, 2024
@MelissaAutumn MelissaAutumn changed the title Add minimum_valid_iat_time to subscriber table Add minimum_valid_iat_time to subscriber table, hook up the rest of the fxa webhook events Jan 10, 2024
@MelissaAutumn MelissaAutumn changed the title Add minimum_valid_iat_time to subscriber table, hook up the rest of the fxa webhook events Add minimum_valid_iat_time to subscriber table, and hook up the rest of the fxa webhook events Jan 10, 2024
@devmount devmount changed the title Add minimum_valid_iat_time to subscriber table, and hook up the rest of the fxa webhook events Add minimum_valid_iat_time to subscriber table, and hook up the rest of the fxa webhook events 🛢 Jan 12, 2024
Copy link
Collaborator

@devmount devmount left a comment

Choose a reason for hiding this comment

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

Looking good Mel, thank you.

One thing though (but I'm sure this is a local issue on my machine), nearly all test fail now on the json decoder. Any ideas?

image

@MelissaAutumn MelissaAutumn merged commit fea6eec into main Jan 12, 2024
1 check passed
@MelissaAutumn MelissaAutumn deleted the features/220-fxa-webhooks branch January 12, 2024 17:57
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