Page MenuHomePhabricator

Migrate OAuth 2 refresh tokens from MainStash to a more approriate storage
Open, Needs TriagePublic

Description

OAuth 2 refresh tokens are stored in MainStash. This is bad:

  • it's a key-value store so there is no way to find all the valid refresh tokens a user has, which seems problematic e.g. for investigating security incidents
  • mass invalidation can only be done in hacky ways
  • MainStash doesn't really guarantee permanence. This will get a lot worse after T383327: Re-architecture mainstash (x2) to allow easier maintenance .

It needs to be moved to a more appropriate storage (probably a dedicated DB table?).

Event Timeline

MainStash doesn't really guarantee permanence. This will get a lot worse after T383327: Re-architecture mainstash (x2) to allow easier maintenance .

As long as it's not setting TTL to infinity, it actually should get better. Previous main stash infra was redis that was actively evicting keys. This one puts it on two db hosts and they will be lost if both hosts get depooled at the same time which is much lower chance of happening than x2 having issues or redis evicting keys.