-
-
Notifications
You must be signed in to change notification settings - Fork 603
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
API key migration must account for keys that pre-date introduction of the odt_
prefix
#4652
Comments
@netomi Thanks, we're working on a fix. |
Fixes DependencyTrack#4652 Signed-off-by: nscuro <nscuro@protonmail.com>
Fixes DependencyTrack#4652 Signed-off-by: nscuro <nscuro@protonmail.com>
Relates to DependencyTrack/dependency-track#4652 Signed-off-by: nscuro <nscuro@protonmail.com>
Relates to DependencyTrack/dependency-track#4652 Signed-off-by: nscuro <nscuro@protonmail.com>
Fixes DependencyTrack#4652 Fixes DependencyTrack#4683 Signed-off-by: nscuro <nscuro@protonmail.com>
Fixes DependencyTrack#4652 Fixes DependencyTrack#4683 Signed-off-by: nscuro <nscuro@protonmail.com>
I did try the latest snapshot version and the keys remained and I still could not delete them via the UI. |
Now when creating a new API Key I get this error on the api server logs:
Edit: I had to delete the column "APIKEY" manually in the database for the APIKEY table, then it worked again. |
@netomi It seems like for some reason the new migration did not run for you. The remaining keys should have been migrated, and the APIKEY column should have been dropped automatically. @msymons tested it yesterday and it worked for him. I also tested various upgrade paths before merging the changes. Can you please check your logs for any errors during the migration? |
I am sorry, I do not have the logs anymore, I restarted the pod after the first failure. However, when looking at the changes, I see that the condition to run the migration is as follows:
but in my case it might not have evaluated to true? Maybe a safer check would be to see if the APIKEY column is still present? |
The migration wasn't running threw, cause the upgrader thougth he was already on 4.13-SNAPSHOT
|
Current Behavior
#4566 introduced a migration to the new API key format, which now includes a "public ID" segment.
The migration does not consider keys that do not match the length of
prefix + key
:dependency-track/src/main/java/org/dependencytrack/upgrade/v4130/v4130Updater.java
Lines 74 to 77 in b42212f
This fails to account for API keys that were generated prior to DT v4.9.0, which is where the
odt_
prefix was first introduced. Keys generated prior to that version won't match the migration logic's length check, and thus won't be migrated.This happened in @msymons' test instance, where the first and oldest key has no public ID assigned (it shows as
null
), and is not marked as legacy (no yellow triangle):Steps to Reproduce
N/A
Expected Behavior
API keys that pre-date v4.9.0 should be migrated correctly.
Dependency-Track Version
4.13.0-SNAPSHOT
Dependency-Track Distribution
Container Image
Database Server
N/A
Database Server Version
No response
Browser
N/A
Checklist
The text was updated successfully, but these errors were encountered: