-
Notifications
You must be signed in to change notification settings - Fork 40
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 Keys hashed in DB #687
base: master
Are you sure you want to change the base?
Conversation
14c1e97
to
98c4461
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. A few comments.
Also, do you have a migration strategy in mind for this? How do we deal with existing API keys that are not hashed yet?
alpine-infra/src/main/java/alpine/persistence/AlpineQueryManager.java
Outdated
Show resolved
Hide resolved
alpine-infra/src/main/java/alpine/persistence/AlpineQueryManager.java
Outdated
Show resolved
Hide resolved
alpine-infra/src/main/java/alpine/persistence/AlpineQueryManager.java
Outdated
Show resolved
Hide resolved
98c4461
to
d053abe
Compare
Simpliest way would be to provide a script, that simply gets every key, hashs it and update it in the DB. Would that suffice, or should it something be, there the user doesn't need to do anything? Then maybe temporarily support both and update it in the code, and after a while only support hashed ones. Or maybe add a function to the code that once gets all keys and updates them. That way you need to once upgrade to this version to get it to work later. |
2 things remaining:
|
24d7862
to
6eb5c39
Compare
@nscuro In Team Creation its no longer possible to create an api Key, which was never even used in DT. |
2bf9b9d
to
0c46cd1
Compare
Only at creation are once returned in plain Signed-off-by: Thomas Schauer-Köckeis <[email protected]>
Now changing API Key after creation should also work Signed-off-by: Thomas Schauer-Köckeis <[email protected]>
create apiKey Signed-off-by: Thomas Schauer-Koeckeis <[email protected]>
Signed-off-by: Thomas Schauer-Koeckeis <[email protected]>
0c46cd1
to
170cf53
Compare
Description
This PR addresses #532 by changing from API Keys being stored in plain to be stored as a hash.
Will be hashed with SHA3_256. Only at creation time are once returned in plain, so it can be used. Adds a suffix to the API Key, on which the key will be retrieved from the db. Masked Key is now at the ending the suffix. Hashed Key will be also not returned in the API.