unkey
unkey copied to clipboard
One Click migration paths
Preliminary Checks
-
[X] I have reviewed https://unkey.dev/docs for existing features that would solve my problem
-
[X] I have searched for existing feature requests: https://github.com/unkeyed/unkey/issues
-
[X] This issue is not a question, general help request, or anything other than a feature request directly related to Unkey. Please ask questions in our Discord community: https://unkey.dev/discord.
Is your feature request related to a problem? Please describe.
There is no one migration paths available
Describe the solution
Provide a 1 click migration option
Describe alternatives you have considered (if any)
No response
Additional context
No response
My previous thoughts about this:
- We will add a new table migrations (migrationId, workspaceId, keyAuthId, encoding, algorithm)
- When a customer wants to migrate, we add a row to start a migration, we ask them what hashing algorithm they used and how they're encoding their keys (eg. base64)
- we will add a new column migrationId to keysand add all of their keys while specifying the migrationId, as hash we use whatever they had previously
- during migration, the customer will send the Unkey-Migration with their migration id along with every request
- if this header is present, we first check the key as usual but if it is not found, we hash and encode the key using the customer's instructions. If the key is now found, we rehash with our own instructions, update the hash and remove the migrationId. The key is now fully migrated.
- Eventually all or enough keys are moved and the customer can stop sending the header
Considerations:
Maybe a separate (almost duplicated) table for keys that need migration would be better, I'm not sure yet