ockam icon indicating copy to clipboard operation
ockam copied to clipboard

Move the `ockam_key_exchange_core` create into `ockam_core`.

Open thomcc opened this issue 4 years ago • 10 comments

This is essentially the same as #2288, but for ockam_key_exchange_core.

We're trying to reduce the number of crates, and part of that is moving ockam_key_exchange_core into a new key_exchange submodule of ockam_core. I think this basically looks like:

  1. Make a new pub mod key_exchange; in ockam_core.

    • Note: unlike the other modules, I think we shouldn't pub use key_exchange::* from the root here, since we'd like to move away from this.
  2. Move the code from ockam_key_exchange_core/src/lib.rs to ockam_core/src/key_exchange.rs.

  3. Update the doc comments so that it says "this module" rather than "this crate" and such. (Ask if you need help wording this).

  4. Change uses of ockam_key_exchange_core::Foo and such to use ockam_core::key_exchange::Foo across our crates.

  5. Delete the ockam_key_exchange_core crate, and any references to it (be sure to check .github/workflows, and to do a search for ockam_key_exchange_core).

That's the basic idea anyway (I may have missed something). Feel free to ask questions if anything is unclear.

thomcc avatar Nov 30 '21 23:11 thomcc

Can I help somehow?

fade2black avatar Dec 03 '21 20:12 fade2black

Absolutely! I'll assign the issue to you, feel free to ask any questions here.

thomcc avatar Dec 03 '21 21:12 thomcc

Hi @thomcc. It is my first contribution to ockam. As far as I understand (from the task description) it is a sort of simple code reorganisation rather than cryptography programming. Am I on the right track?

fade2black avatar Dec 03 '21 21:12 fade2black

@fade2black yes that's right, only a code reorganisation.

mrinalwadhwa avatar Dec 03 '21 22:12 mrinalwadhwa

@thomcc @mrinalwadhwa I removed all refs to the create, but we have a file rust_test_ockam_ockam_key_exchange_core.yml in the workflow folder. May/should I delete it?

fade2black avatar Dec 07 '21 19:12 fade2black

yes please delete it

mrinalwadhwa avatar Dec 07 '21 19:12 mrinalwadhwa

@mrinalwadhwa I guess rust_build_ockam_ockam_key_exchange_core.yml and rust_lint_ockam_ockam_key_exchange_core.yml too?

fade2black avatar Dec 07 '21 20:12 fade2black

Yes *ockam_ockam_key_exchange_core.yml can be deleted

mrinalwadhwa avatar Dec 07 '21 20:12 mrinalwadhwa

@mrinalwadhwa I'm struggling with

use ockam_vault_core::Secret;

ockam_vault_core crate is used inside the key_exchange.rs. I tried to include that crate but it leads to a cyclic dependency error since ockam_vault_core itself depends on ockam_core

[dependencies]
ockam_core = { path = "../ockam_core", version = "^0.41.0", default_features = false }

Any idea how to resolve the dependency?

fade2black avatar Dec 07 '21 20:12 fade2black

@fade2black I think the simplest approach would be to wait for https://github.com/ockam-network/ockam/pull/2324 to land. Where @totsteps is moving ockam_vault_core as per https://github.com/ockam-network/ockam/issues/2288

mrinalwadhwa avatar Dec 08 '21 02:12 mrinalwadhwa