Skip to content

tor-keymgr: Make KeyMgr a wrapper over KeyMgrInner.

gabi-250 requested to merge gabi-250/arti:keymgr-traits into main

This is a follow-up from !2572 (closed)

When adding new functions to KeyMgr, it's currently very easy to forget to add a corresponding implementation to the dummy KeyMgr. In fact, the dummy implementation is currently missing a lot of the functions we have on the fully-featured KeyMgr.

This moves the KeyMgr impl to a new (crate-private) KeyMgrInner type that implements the keymgr API. This change will enable us to keep the dummy KeyMgr implementation in sync with the "real" one: if we add new functions to the KeyMgr API, we are forced to implement them for the dummy KeyMgrInner type too, because otherwise the --no-default-features build of arti will fail to compile.

Some of this could be improved with macrology (there's a lot of boilerplate around KeyMgr/KeyMgrInner), but I propose we do that later (in a future MR).

Most of the commits in this MR are best reviewed with --color-moved.

Merge request reports

Loading