-
Notifications
You must be signed in to change notification settings - Fork 106
Description
Is your feature request related to a problem? Please describe.
Currently the PK on APIKey model (or derived models) is a string in the form of {prefix}.{hash}. While not completely insecure, this string contains special characters so it's tricky to pass in URLs, making it hard to build frontend API key management functionality.
Describe the solution you'd like
Convert the APIKey PK to a standard autoincremented integer.
A migration and detailed upgrade instructions should be provided to make this change non-breaking (no API keys should be lost/have to be regenerated in the process).
Describe alternatives you've considered
/
Additional context
This is a long-discussed feature, and actually there has been discussion on this in the past:
- Change the PK field #40: same request as this issue, ended up with an implementation in Change PK to auto integer and split key into prefix and hashed_key fi… #41, merged into
dev/2.0. - Add migration guide for integer PK field #48 discussed the non-trivial migrations necessary to perform this change, based on useful hints in Change PK to auto integer and split key into prefix and hashed_key fi… #41 (comment).
- Simplified autoincremented integer ID migration #61 discussed a simplified migration path thanks to splitting
prefixandhashed_keyinto proper database fields (which we now have since Proper prefix and hashed_key fields #60 has been resolved).
So to solve this we should:
- Go over the changes in Change PK to auto integer and split key into prefix and hashed_key fi… #41
- Adapt the migration to meet hints in Change PK to auto integer and split key into prefix and hashed_key fi… #41 (comment)
- Include a preliminary 3.0 update guide that includes detailed migration instructions.