-
Notifications
You must be signed in to change notification settings - Fork 886
chore: Force license uuids to not be null #6012
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
Conversation
This did make unit tests fail: https://github.com/coder/coder/actions/runs/4080226583/jobs/7032466456#step:9:169 |
It's unclear to me why we needed a UUID in the first place. We had just an |
@spikecurtis I am not sure. I do not think this PR is the fix, but something should be done. |
Looks like UUIDs were added in #5110 @kylecarbs can you bring us up to speed on why UUIDs were added and whether we can drop one or other of |
We could make the code accept invalid uuids if the license is generated before Feb 8, 2023 for example. Any new licenses have to have valid uuids. |
@kylecarbs bump |
@Emyrk Is it now the case that the UUID is embedded in the signed license itself, or its it just a DB identifier local to the deployment it is installed on? |
It is embedded to the license claims. We insert a uuid string in the JWT ID field: https://github.com/coder/license/blob/2ae8cabd512f05b58ab871d41e6327bbc405a00d/cmd/licensor/issue.go#L79-L79 |
@spikecurtis uuids were added to licenses 4 months ago: https://github.com/coder/license/commit/2d26cbd6f689b566a2e84b47d98f94748e2c7fa5 I am not sure if licenses exist without uuids. It is possible. However I think we could just force the error if the license is made after a certain date to handle any old formats. |
Would this stop old licenses from working @Emyrk? |
@kylecarbs To support old licenses that fail This PR does not do that yet. |
I am going to generate a random uuid for licenses that do not have uuids. This will make old and new licenses work. A followup should be to require uuids, potentially breaking old licenses. |
What this does
All new licenses have uuids, old licenses might not. So this PR gives old licenses a random uuid to support a non-null database schema.
Future work
We should require licenses to have uuids or fail. Breaking old licenses.