-
Notifications
You must be signed in to change notification settings - Fork 367
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
Implement an abstact keystore API #3342
Comments
Except for making the three keystore API functions non-static, there are no code changes here, it's all just moving stuff around. Thus, there cannot be any functionality changes either. The internal API here should not be considered final, this is just a stepping stone to hide the keystore internals from the rest of the rpmts layer. Related: rpm-software-management#3342
Except for making the three keystore API functions non-static, there are no code changes here, it's all just moving stuff around. Thus, there cannot be any functionality changes either. The internal API here should not be considered final, this is just a stepping stone to hide the keystore internals from the rest of the rpmts layer. Related: #3342
Pass pubkeys down to the keystore on import, and let the keystore handle the actual format. For rpmdb keystore this remains the header, so it's a no-op there, but on the fs keystore we drop the trailing "time or something" hex garbage from the filename because we no longer have it at hand but also because it's just not relevant for anything. The key load glob is relaxed enough that we still pick the old format keys too. Related: rpm-software-management#3342
Pass pubkeys down to the keystore on import, and let the keystore handle the actual format. For rpmdb keystore this remains the header, so it's a no-op there, but on the fs keystore we drop the trailing "time or something" hex garbage from the filename because we no longer have it at hand but also because it's just not relevant for anything. The key load glob is relaxed enough that we still pick the old format keys too. Related: rpm-software-management#3342
Pass pubkeys down to the keystore on import, and let the keystore handle the actual format. For rpmdb keystore this remains the header, so it's a no-op there, but on the fs keystore we drop the trailing "time or something" hex garbage from the filename because we no longer have it at hand but also because it's just not relevant for anything. The key load glob is relaxed enough that we still pick the old format keys too. Related: #3342
AC proposal (or what I have in mind here anyhow):
Edit: method names lowercased |
...which is pretty close to what we already have, but having it in a self-sufficient class instead of integer to hold the type should allow for "rebuild" type operation as well. It's also super minimal, we'll probably want an iterator for the contents later but as this is an internal-only API it can evolve more freely. |
Take read-only transaction lock at the rpmts side, pass it down the rpmKeystoreLoad() hatch. Somehow this feels like an overkill but then our keystores haven't been designed with concurrent access in mind *at all*, so play safe and just take a read lock while loading they keystore. It also balances the API: everything just takes a txn item now. Related: rpm-software-management#3342
Take read-only transaction lock at the rpmts side, pass it down the rpmKeystoreLoad() hatch. Somehow this feels like an overkill but then our keystores haven't been designed with concurrent access in mind *at all*, so play safe and just take a read lock while loading they keystore. It also balances the API: everything just takes a txn item now. Related: #3342
Except that the method names are a disaster 😆 because 2/3 conflict with C++ keywords and "load" is just as generic so you never know. Changing these to
|
Add an abstract rpm::keystore class and port our existing rpmdb and fs keystores to that. The keystore code as such doesn't really change at all in here, the bigger change is the way it's initialized because it's an object instead of just an integer in the rpmts struct. As a kind of side-effect, we introduce the rpm:: namespace here. Fixes: rpm-software-management#3342
Add an abstract rpm::keystore class and port our existing rpmdb and fs keystores to that. The keystore code as such doesn't really change at all in here, the bigger change is the way it's initialized because it's an object instead of just an integer in the rpmts struct. As a kind of side-effect, we introduce the rpm:: namespace here. Fixes: #3342
The support for rpmdb and fs keystores are currently buried in lib/rpmts.c special case code, for historical reasons.
We should add a proper keystore API that supports import, delete and read operations on different backends of choice, and move the relevant parts of the existing code there.
The text was updated successfully, but these errors were encountered: