facebook / akd

An implementation of an auditable key directory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exporting from `akd_core` adjustments needed

slawlor opened this issue · comments

We have to often reference both crates which should not be necessary if re-exports are done correctly.

  1. akd should re-export ecvrf perhaps under a "vrf" module
  2. akd should re-export proto and the types (if protobuf enabled)
  3. (1) and (2) for akd_client as well

This "might" be less of a problem than I originally thought. Since we

pub use akd_core::*;

in both akd and akd_client we are re-exporting all the public types at the root + all the sub-modules of akd_core into the parent crate. So that means akd_client::hash::Digest is a valid entry pointing to the proper Digest impl in akd_core.

The only real problem I've run into is if there's a module clash, like in akd with proto since both akd_client and akd have a proto defined module, only the akd defined one is available. This means to utilize the protobuf conversions, one needs to reference akd_core. Example

let proto: akd_core::proto::specs::types::HistoryProof = (&proof).into()

where we should be able to do this with just the akd crate if done properly. Also the stuff in the akd::proto module isn't really protobuf logic, and more audit logic with protobuf support so it might just be as easy as moving that module.