diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 00000000..8b2918fa --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,58 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - publish + +jobs: + + # Release unpublished packages. + release-plz-release: + name: Release-plz release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + # Create a PR with the new versions and changelog, preparing the next release. + release-plz-pr: + name: Release-plz PR + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.release-plz.toml b/.release-plz.toml new file mode 100644 index 00000000..c5d6b5f4 --- /dev/null +++ b/.release-plz.toml @@ -0,0 +1,5 @@ +# Example config: https://release-plz.dev/docs/config#example +[workspace] +# changelog_config = "config/git-cliff.toml" # use a custom git-cliff configuration +changelog_update = false # disable changelog updates +dependencies_update = true # update dependencies with `cargo update` diff --git a/Cargo.toml b/Cargo.toml index dbb5db5d..c033c9a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,28 +1,87 @@ [package] name = "trustchain" version = "0.2.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "Trustchain decentralised PKI reference implementation." + +[workspace] +members = ["crates/*"] +resolver = "2" + +[workspace.package] authors = ["Trustchain Devs"] license = "MIT OR Apache-2.0" description = "Trustchain decentralised PKI reference implementation." homepage = "https://alan-turing-institute.github.io/trustchain/" repository = "https://github.com/alan-turing-institute/trustchain/" keywords = ["pki", "did", "vc", "vp"] -edition = "2021" +edition = "2021" -[workspace] -members = [ - "trustchain-core", - "trustchain-ion", - "trustchain-http", - "trustchain-api", - "trustchain-cli", - "trustchain-ffi" -] -resolver = "2" +[workspace.dependencies] +anyhow = "1.0" +async-trait = "0.1" +axum = "0.6" +axum-server = "0.5.1" +axum-test-helper = "0.2.0" +bip39 = "2.0.0" +bitcoin = "0.29.2" +bitcoincore-rpc = "0.16.0" +chrono = "0.4.26" +clap = "4.0.32" +did-ion = "0.2" +did-method-key = "0.2.2" +ed25519-dalek-bip32 = "0.3.0" +flate2 = "1.0.24" +flutter_rust_bridge = "=1.64.0" +futures = "0.3.28" +glob = "0.3" +hex = "0.4.3" +hyper = "0.14.26" +image = "0.23.14" +ipfs-api-backend-hyper = "0.6" +ipfs-hasher = "0.13.0" +is_empty = "0.2.0" +itertools = "0.13.0" +josekit = "0.8" +k256 = "0.13.1" +lazy_static = "1.4.0" +log = "0.4" +mockall = "0.11.4" +mongodb = "2.3.1" +petgraph = "0.6" +port_check = "0.2.1" +qrcode = "0.12.0" +rand = "0.8" +reqwest = "0.11.16" +secp256k1 = "0.27.0" +serde = "1.0" +serde_jcs = "0.1.0" +serde_json = "1.0" +serde_with = "3.4.0" +sha2 = "0.10.7" +shellexpand = "3.1.0" +ssi = "0.7" +tempfile = "3.9.0" +thiserror = "1.0" +tokio = "1.20.1" +toml = "0.7.2" +tower = "0.4" +tracing = "0.1" +tracing-subscriber = "0.3" [dependencies] -trustchain-api = { path = "./trustchain-api", version = "0.1.0"} -trustchain-core = { path = "./trustchain-core", version = "0.2.0"} -trustchain-ffi = { path = "./trustchain-ffi", version = "0.1.0"} -trustchain-http = { path = "./trustchain-http", version = "0.1.0"} -trustchain-ion = { path = "./trustchain-ion", version = "0.2.0"} +trustchain-api = { path = "crates/trustchain-api", version = "0.1.0" } +trustchain-core = { path = "crates/trustchain-core", version = "0.2.0" } +trustchain-ffi = { path = "crates/trustchain-ffi", version = "0.1.0", optional = true } +trustchain-http = { path = "crates/trustchain-http", version = "0.1.0", optional = true } +trustchain-ion = { path = "crates/trustchain-ion", version = "0.2.0", optional = true } + +[features] +default = [] +http = ["dep:trustchain-http"] +ion = ["dep:trustchain-ion"] +ffi = ["dep:trustchain-ffi"] diff --git a/README.md b/README.md index 27c3edf9..7eb30e6d 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ cargo build ``` Install the Trustchain CLI with: ```shell -cargo install --path trustchain-cli +cargo install --path crates/trustchain-cli ``` ## Usage Guide diff --git a/crates/trustchain-api/Cargo.toml b/crates/trustchain-api/Cargo.toml new file mode 100644 index 00000000..936ae8c8 --- /dev/null +++ b/crates/trustchain-api/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "trustchain-api" +version = "0.1.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "API for Trustchain." + +[dependencies] + +async-trait = { workspace = true } +chrono = { workspace = true } +did-ion = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +serde_json = { workspace = true } +sha2 = { workspace = true } +ssi = { workspace = true, features = ["http-did", "secp256k1"] } +trustchain-core = { path = "../trustchain-core" } +trustchain-ion = { path = "../trustchain-ion" } + +[dev-dependencies] +tokio = { workspace = true, features = ["full"] } diff --git a/trustchain-api/src/api.rs b/crates/trustchain-api/src/api.rs similarity index 99% rename from trustchain-api/src/api.rs rename to crates/trustchain-api/src/api.rs index 8470f4ef..c66ff42c 100644 --- a/trustchain-api/src/api.rs +++ b/crates/trustchain-api/src/api.rs @@ -351,12 +351,11 @@ mod tests { TrustchainDataAPI, TrustchainVCAPI, TrustchainVPAPI, DATA_CREDENTIAL_TEMPLATE, }; use crate::TrustchainAPI; - use did_ion::sidetree::PublicKeyEntry; use sha2::{Digest, Sha256}; use ssi::jsonld::ContextLoader; use ssi::ldp::now_ns; use ssi::one_or_many::OneOrMany; - use ssi::vc::{Credential, CredentialOrJWT, CredentialSubject, Presentation, VCDateTime, URI}; + use ssi::vc::{Credential, CredentialOrJWT, Presentation, VCDateTime, URI}; use trustchain_core::utils::init; use trustchain_core::vc::{CredentialError, DataCredentialError}; use trustchain_core::vp::PresentationError; diff --git a/trustchain-api/src/lib.rs b/crates/trustchain-api/src/lib.rs similarity index 100% rename from trustchain-api/src/lib.rs rename to crates/trustchain-api/src/lib.rs diff --git a/crates/trustchain-cli/Cargo.toml b/crates/trustchain-cli/Cargo.toml new file mode 100644 index 00000000..14e1df21 --- /dev/null +++ b/crates/trustchain-cli/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "trustchain-cli" +version = "0.1.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "CLI for Trustchain." + +[[bin]] +name = "trustchain-cli" +path = "src/bin/main.rs" + +[dependencies] + +clap = { workspace = true, features = ["derive", "cargo"] } +lazy_static = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +ssi = { workspace = true, features = ["http-did", "secp256k1"] } +tokio = { workspace = true, features = ["full"] } +toml = { workspace = true } +trustchain-api = { path = "../trustchain-api" } +trustchain-core = { path = "../trustchain-core" } +trustchain-http = { path = "../trustchain-http" } +trustchain-ion = { path = "../trustchain-ion" } diff --git a/trustchain-cli/src/bin/main.rs b/crates/trustchain-cli/src/bin/main.rs similarity index 100% rename from trustchain-cli/src/bin/main.rs rename to crates/trustchain-cli/src/bin/main.rs diff --git a/trustchain-cli/src/config.rs b/crates/trustchain-cli/src/config.rs similarity index 100% rename from trustchain-cli/src/config.rs rename to crates/trustchain-cli/src/config.rs diff --git a/trustchain-cli/src/lib.rs b/crates/trustchain-cli/src/lib.rs similarity index 100% rename from trustchain-cli/src/lib.rs rename to crates/trustchain-cli/src/lib.rs diff --git a/crates/trustchain-core/Cargo.toml b/crates/trustchain-core/Cargo.toml new file mode 100644 index 00000000..112a3f1e --- /dev/null +++ b/crates/trustchain-core/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "trustchain-core" +version = "0.2.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "Core Trustchain functionality." + +[dependencies] +async-trait = { workspace = true } +base64 = "0.13" +did-method-key = { workspace = true } +petgraph = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_jcs = { workspace = true } +serde_json = { workspace = true } +sha2 = { workspace = true } +ssi = { workspace = true, features = ["http-did", "secp256k1"] } +tempfile = { workspace = true } +thiserror = { workspace = true } + +[dev-dependencies] +mockall = { workspace = true } diff --git a/trustchain-core/src/attestor.rs b/crates/trustchain-core/src/attestor.rs similarity index 100% rename from trustchain-core/src/attestor.rs rename to crates/trustchain-core/src/attestor.rs diff --git a/trustchain-core/src/chain.rs b/crates/trustchain-core/src/chain.rs similarity index 100% rename from trustchain-core/src/chain.rs rename to crates/trustchain-core/src/chain.rs diff --git a/trustchain-core/src/commitment.rs b/crates/trustchain-core/src/commitment.rs similarity index 100% rename from trustchain-core/src/commitment.rs rename to crates/trustchain-core/src/commitment.rs diff --git a/trustchain-core/src/controller.rs b/crates/trustchain-core/src/controller.rs similarity index 100% rename from trustchain-core/src/controller.rs rename to crates/trustchain-core/src/controller.rs diff --git a/trustchain-core/src/data.rs b/crates/trustchain-core/src/data.rs similarity index 100% rename from trustchain-core/src/data.rs rename to crates/trustchain-core/src/data.rs diff --git a/trustchain-core/src/display.rs b/crates/trustchain-core/src/display.rs similarity index 100% rename from trustchain-core/src/display.rs rename to crates/trustchain-core/src/display.rs diff --git a/trustchain-core/src/graph.rs b/crates/trustchain-core/src/graph.rs similarity index 99% rename from trustchain-core/src/graph.rs rename to crates/trustchain-core/src/graph.rs index cc3912eb..3761c9f1 100644 --- a/trustchain-core/src/graph.rs +++ b/crates/trustchain-core/src/graph.rs @@ -136,7 +136,7 @@ mod tests { fn test_display() -> Result<(), GraphError> { let chains = vec![test_chain(), test_chain()]; let graph = TrustchainGraph::new(&chains, DEFAULT_LABEL_WIDTH)?; - format!("{}", graph); + let _ = format!("{}", graph); Ok(()) } } diff --git a/trustchain-core/src/holder.rs b/crates/trustchain-core/src/holder.rs similarity index 100% rename from trustchain-core/src/holder.rs rename to crates/trustchain-core/src/holder.rs diff --git a/trustchain-core/src/issuer.rs b/crates/trustchain-core/src/issuer.rs similarity index 100% rename from trustchain-core/src/issuer.rs rename to crates/trustchain-core/src/issuer.rs diff --git a/trustchain-core/src/key_manager.rs b/crates/trustchain-core/src/key_manager.rs similarity index 100% rename from trustchain-core/src/key_manager.rs rename to crates/trustchain-core/src/key_manager.rs diff --git a/trustchain-core/src/lib.rs b/crates/trustchain-core/src/lib.rs similarity index 100% rename from trustchain-core/src/lib.rs rename to crates/trustchain-core/src/lib.rs diff --git a/trustchain-core/src/resolver.rs b/crates/trustchain-core/src/resolver.rs similarity index 100% rename from trustchain-core/src/resolver.rs rename to crates/trustchain-core/src/resolver.rs diff --git a/trustchain-core/src/subject.rs b/crates/trustchain-core/src/subject.rs similarity index 100% rename from trustchain-core/src/subject.rs rename to crates/trustchain-core/src/subject.rs diff --git a/trustchain-core/src/utils.rs b/crates/trustchain-core/src/utils.rs similarity index 100% rename from trustchain-core/src/utils.rs rename to crates/trustchain-core/src/utils.rs diff --git a/trustchain-core/src/vc.rs b/crates/trustchain-core/src/vc.rs similarity index 100% rename from trustchain-core/src/vc.rs rename to crates/trustchain-core/src/vc.rs diff --git a/trustchain-core/src/verifier.rs b/crates/trustchain-core/src/verifier.rs similarity index 100% rename from trustchain-core/src/verifier.rs rename to crates/trustchain-core/src/verifier.rs diff --git a/trustchain-core/src/vp.rs b/crates/trustchain-core/src/vp.rs similarity index 100% rename from trustchain-core/src/vp.rs rename to crates/trustchain-core/src/vp.rs diff --git a/crates/trustchain-ffi/Cargo.toml b/crates/trustchain-ffi/Cargo.toml new file mode 100644 index 00000000..7f004b28 --- /dev/null +++ b/crates/trustchain-ffi/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "trustchain-ffi" +version = "0.1.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "FFI for Trustchain." + +[lib] +crate-type = ["cdylib", "staticlib", "lib"] +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +anyhow = { workspace = true } +chrono = { workspace = true } +did-ion = { workspace = true } +# Fixed to same version used to generate bridge: `flutter_rust_bridge_codegen@1.64.0` +flutter_rust_bridge = { workspace = true } +lazy_static = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +ssi = { workspace = true, features = ["http-did", "secp256k1"] } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["rt-multi-thread"] } +toml = { workspace = true } +trustchain-api = { path = "../trustchain-api" } +trustchain-core = { path = "../trustchain-core" } +trustchain-http = { path = "../trustchain-http" } +trustchain-ion = { path = "../trustchain-ion" } diff --git a/trustchain-ffi/README.md b/crates/trustchain-ffi/README.md similarity index 100% rename from trustchain-ffi/README.md rename to crates/trustchain-ffi/README.md diff --git a/trustchain-ffi/src/config.rs b/crates/trustchain-ffi/src/config.rs similarity index 100% rename from trustchain-ffi/src/config.rs rename to crates/trustchain-ffi/src/config.rs diff --git a/trustchain-ffi/src/gui.rs b/crates/trustchain-ffi/src/gui.rs similarity index 100% rename from trustchain-ffi/src/gui.rs rename to crates/trustchain-ffi/src/gui.rs diff --git a/trustchain-ffi/src/lib.rs b/crates/trustchain-ffi/src/lib.rs similarity index 100% rename from trustchain-ffi/src/lib.rs rename to crates/trustchain-ffi/src/lib.rs diff --git a/trustchain-ffi/src/mobile.rs b/crates/trustchain-ffi/src/mobile.rs similarity index 90% rename from trustchain-ffi/src/mobile.rs rename to crates/trustchain-ffi/src/mobile.rs index aae0008a..51570b39 100644 --- a/trustchain-ffi/src/mobile.rs +++ b/crates/trustchain-ffi/src/mobile.rs @@ -248,8 +248,8 @@ pub fn create_operation_mnemonic(mnemonic: String) -> Result { #[cfg(test)] mod tests { use ssi::vc::CredentialOrJWT; - use trustchain_core::utils::canonicalize_str; - use trustchain_http::utils::init_http; + use trustchain_core::utils::{canonicalize_str, init}; + use trustchain_http::config::HTTPConfig; use crate::config::parse_toml; @@ -376,29 +376,63 @@ mod tests { "did": "did:ion:test:EiA1dZD7jVkS5ZP7JJO01t6HgTU3eeLpbKEV1voOFWJV0g" }"#; + fn init_http_ephemeral() -> u16 { + init(); + // Create channel to receive port number from the thread with the server + let (tx, rx) = std::sync::mpsc::channel(); + std::thread::spawn(move || { + let http_config = HTTPConfig { + host: "127.0.0.1".parse().unwrap(), + port: 0, + server_did: Some( + "did:ion:test:EiBVpjUxXeSRJpvj2TewlX9zNF3GKMCKWwGmKBZqF6pk_A".to_owned(), + ), + root_event_time: Some(1666265405), + ..Default::default() + }; + let rt = Runtime::new().unwrap(); + rt.block_on(async { + let server = trustchain_http::server::http_server(http_config); + // Send assigned ephemeral port number to receiver + tx.send(server.local_addr().port()).unwrap(); + server.await.unwrap(); + }); + }); + // Receive port number to return for client + rx.recv().unwrap() + } + + fn ffi_opts_with_port(ffi_config: &str, port: u16) -> String { + let mut ffi_config = parse_toml(ffi_config); + ffi_config + .endpoint_options + .as_mut() + .unwrap() + .trustchain_endpoint + .port = port; + serde_json::to_string(&ffi_config).unwrap() + } + #[test] #[ignore = "integration test requires ION, MongoDB, IPFS and Bitcoin RPC"] fn test_did_resolve() { - init_http(); + let ffi_opts = ffi_opts_with_port(TEST_FFI_CONFIG, init_http_ephemeral()); let did = "did:ion:test:EiAtHHKFJWAk5AsM3tgCut3OiBY4ekHTf66AAjoysXL65Q".to_string(); - let ffi_opts = serde_json::to_string(&parse_toml(TEST_FFI_CONFIG)).unwrap(); did_resolve(did, ffi_opts).unwrap(); } #[test] #[ignore = "integration test requires ION, MongoDB, IPFS and Bitcoin RPC"] fn test_did_verify() { - init_http(); + let ffi_opts = ffi_opts_with_port(TEST_FFI_CONFIG, init_http_ephemeral()); let did = "did:ion:test:EiAtHHKFJWAk5AsM3tgCut3OiBY4ekHTf66AAjoysXL65Q".to_string(); - let ffi_opts = serde_json::to_string(&parse_toml(TEST_FFI_CONFIG)).unwrap(); did_verify(did, ffi_opts).unwrap(); } #[test] #[ignore = "integration test requires ION, MongoDB, IPFS and Bitcoin RPC"] fn test_vc_verify_credential() { - init_http(); - let ffi_opts = serde_json::to_string(&parse_toml(TEST_FFI_CONFIG)).unwrap(); + let ffi_opts = ffi_opts_with_port(TEST_FFI_CONFIG, init_http_ephemeral()); let credential: Credential = serde_json::from_str(TEST_CREDENTIAL).unwrap(); vc_verify_credential(serde_json::to_string(&credential).unwrap(), ffi_opts).unwrap(); } @@ -406,7 +440,7 @@ mod tests { #[test] #[ignore = "integration test requires ION, MongoDB, IPFS and Bitcoin RPC"] fn test_vp_issue_presentation() { - let ffi_opts = serde_json::to_string(&parse_toml(TEST_FFI_CONFIG)).unwrap(); + let ffi_opts = ffi_opts_with_port(TEST_FFI_CONFIG, init_http_ephemeral()); let credential: Credential = serde_json::from_str(TEST_CREDENTIAL).unwrap(); let root_plus_1_did: &str = "did:ion:test:EiBVpjUxXeSRJpvj2TewlX9zNF3GKMCKWwGmKBZqF6pk_A"; let presentation: Presentation = Presentation { @@ -446,8 +480,7 @@ mod tests { #[test] #[ignore = "integration test requires ION, MongoDB, IPFS and Bitcoin RPC"] fn test_vp_verify_presentation() { - init_http(); - let ffi_opts = serde_json::to_string(&parse_toml(TEST_FFI_CONFIG)).unwrap(); + let ffi_opts = ffi_opts_with_port(TEST_FFI_CONFIG, init_http_ephemeral()); vp_verify_presentation(TEST_PRESENTATION.to_string(), ffi_opts).unwrap(); } diff --git a/trustchain-ffi/src/mobile_bridge.io.rs b/crates/trustchain-ffi/src/mobile_bridge.io.rs similarity index 100% rename from trustchain-ffi/src/mobile_bridge.io.rs rename to crates/trustchain-ffi/src/mobile_bridge.io.rs diff --git a/trustchain-ffi/src/mobile_bridge.rs b/crates/trustchain-ffi/src/mobile_bridge.rs similarity index 100% rename from trustchain-ffi/src/mobile_bridge.rs rename to crates/trustchain-ffi/src/mobile_bridge.rs diff --git a/crates/trustchain-http/Cargo.toml b/crates/trustchain-http/Cargo.toml new file mode 100644 index 00000000..993e82e0 --- /dev/null +++ b/crates/trustchain-http/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "trustchain-http" +version = "0.1.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "HTTP Trustchain library and application." + +[[bin]] +name = "trustchain-http" +path = "src/bin/main.rs" + +[dependencies] + +async-trait = { workspace = true } +axum = { workspace = true } +axum-server = { workspace = true, features = ["tls-rustls"] } +base64 = "0.21.0" +chrono = { workspace = true } +did-ion = { workspace = true } +hyper = { workspace = true } +image = { workspace = true } +is_empty = { workspace = true } +josekit = { workspace = true } +lazy_static = { workspace = true } +log = { workspace = true } +qrcode = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true, features = ["stream"] } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +serde_with = { workspace = true } +shellexpand = { workspace = true } +ssi = { workspace = true, features = ["http-did", "secp256k1"] } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full"] } +toml = { workspace = true } +tower = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +trustchain-api = { path = "../trustchain-api" } +trustchain-core = { path = "../trustchain-core" } +trustchain-ion = { path = "../trustchain-ion" } + +[dev-dependencies] +axum-test-helper = { workspace = true } +itertools = { workspace = true } +mockall = { workspace = true } +port_check = { workspace = true } +tempfile = { workspace = true } diff --git a/trustchain-http/src/attestation_encryption_utils.rs b/crates/trustchain-http/src/attestation_encryption_utils.rs similarity index 100% rename from trustchain-http/src/attestation_encryption_utils.rs rename to crates/trustchain-http/src/attestation_encryption_utils.rs diff --git a/trustchain-http/src/attestation_utils.rs b/crates/trustchain-http/src/attestation_utils.rs similarity index 100% rename from trustchain-http/src/attestation_utils.rs rename to crates/trustchain-http/src/attestation_utils.rs diff --git a/trustchain-http/src/attestor.rs b/crates/trustchain-http/src/attestor.rs similarity index 100% rename from trustchain-http/src/attestor.rs rename to crates/trustchain-http/src/attestor.rs diff --git a/trustchain-http/src/bin/main.rs b/crates/trustchain-http/src/bin/main.rs similarity index 100% rename from trustchain-http/src/bin/main.rs rename to crates/trustchain-http/src/bin/main.rs diff --git a/trustchain-http/src/config.rs b/crates/trustchain-http/src/config.rs similarity index 100% rename from trustchain-http/src/config.rs rename to crates/trustchain-http/src/config.rs diff --git a/trustchain-http/src/data.rs b/crates/trustchain-http/src/data.rs similarity index 100% rename from trustchain-http/src/data.rs rename to crates/trustchain-http/src/data.rs diff --git a/trustchain-http/src/errors.rs b/crates/trustchain-http/src/errors.rs similarity index 100% rename from trustchain-http/src/errors.rs rename to crates/trustchain-http/src/errors.rs diff --git a/trustchain-http/src/ion.rs b/crates/trustchain-http/src/ion.rs similarity index 100% rename from trustchain-http/src/ion.rs rename to crates/trustchain-http/src/ion.rs diff --git a/trustchain-http/src/issuer.rs b/crates/trustchain-http/src/issuer.rs similarity index 100% rename from trustchain-http/src/issuer.rs rename to crates/trustchain-http/src/issuer.rs diff --git a/trustchain-http/src/lib.rs b/crates/trustchain-http/src/lib.rs similarity index 97% rename from trustchain-http/src/lib.rs rename to crates/trustchain-http/src/lib.rs index b8d92d72..7f6840e5 100644 --- a/trustchain-http/src/lib.rs +++ b/crates/trustchain-http/src/lib.rs @@ -17,7 +17,6 @@ pub mod server; pub mod state; pub mod static_handlers; pub mod store; -pub mod utils; pub mod verifier; /// Fragment for service ID of Trustchain attestion diff --git a/trustchain-http/src/middleware.rs b/crates/trustchain-http/src/middleware.rs similarity index 100% rename from trustchain-http/src/middleware.rs rename to crates/trustchain-http/src/middleware.rs diff --git a/trustchain-http/src/qrcode.rs b/crates/trustchain-http/src/qrcode.rs similarity index 100% rename from trustchain-http/src/qrcode.rs rename to crates/trustchain-http/src/qrcode.rs diff --git a/trustchain-http/src/requester.rs b/crates/trustchain-http/src/requester.rs similarity index 100% rename from trustchain-http/src/requester.rs rename to crates/trustchain-http/src/requester.rs diff --git a/trustchain-http/src/resolver.rs b/crates/trustchain-http/src/resolver.rs similarity index 100% rename from trustchain-http/src/resolver.rs rename to crates/trustchain-http/src/resolver.rs diff --git a/trustchain-http/src/root.rs b/crates/trustchain-http/src/root.rs similarity index 100% rename from trustchain-http/src/root.rs rename to crates/trustchain-http/src/root.rs diff --git a/trustchain-http/src/server.rs b/crates/trustchain-http/src/server.rs similarity index 100% rename from trustchain-http/src/server.rs rename to crates/trustchain-http/src/server.rs diff --git a/trustchain-http/src/state.rs b/crates/trustchain-http/src/state.rs similarity index 100% rename from trustchain-http/src/state.rs rename to crates/trustchain-http/src/state.rs diff --git a/trustchain-http/src/static_handlers.rs b/crates/trustchain-http/src/static_handlers.rs similarity index 100% rename from trustchain-http/src/static_handlers.rs rename to crates/trustchain-http/src/static_handlers.rs diff --git a/trustchain-http/src/store.rs b/crates/trustchain-http/src/store.rs similarity index 100% rename from trustchain-http/src/store.rs rename to crates/trustchain-http/src/store.rs diff --git a/trustchain-http/src/temp_s_key.json b/crates/trustchain-http/src/temp_s_key.json similarity index 99% rename from trustchain-http/src/temp_s_key.json rename to crates/trustchain-http/src/temp_s_key.json index 79927b1a..6ea30505 100644 --- a/trustchain-http/src/temp_s_key.json +++ b/crates/trustchain-http/src/temp_s_key.json @@ -6,4 +6,4 @@ "y": "z737jJY7kxW_lpE1eZur-9n9_HUEGFyBGsTdChzI4Kg", "d": "CfdUwQ-CcBQkWpIDPjhSJAq2SCg6hAGdcvLmCj0aA-c" } -} \ No newline at end of file +} diff --git a/trustchain-http/src/test.json b/crates/trustchain-http/src/test.json similarity index 99% rename from trustchain-http/src/test.json rename to crates/trustchain-http/src/test.json index 0aa0af02..fbdc1a12 100644 --- a/trustchain-http/src/test.json +++ b/crates/trustchain-http/src/test.json @@ -10,4 +10,4 @@ "requester_org": "myTrustworthyEntity", "operator_name": "trustworthyOperator" } -} \ No newline at end of file +} diff --git a/trustchain-http/src/test_p_key.json b/crates/trustchain-http/src/test_p_key.json similarity index 99% rename from trustchain-http/src/test_p_key.json rename to crates/trustchain-http/src/test_p_key.json index 97bb895b..6f6c1c15 100644 --- a/trustchain-http/src/test_p_key.json +++ b/crates/trustchain-http/src/test_p_key.json @@ -9,4 +9,4 @@ "requester_org": "myTrustworthyEntity", "operator_name": "trustworthyOperator" } -} \ No newline at end of file +} diff --git a/trustchain-http/src/verifier.rs b/crates/trustchain-http/src/verifier.rs similarity index 100% rename from trustchain-http/src/verifier.rs rename to crates/trustchain-http/src/verifier.rs diff --git a/trustchain-http/static/index.html b/crates/trustchain-http/static/index.html similarity index 100% rename from trustchain-http/static/index.html rename to crates/trustchain-http/static/index.html diff --git a/trustchain-http/static/issuer.html b/crates/trustchain-http/static/issuer.html similarity index 100% rename from trustchain-http/static/issuer.html rename to crates/trustchain-http/static/issuer.html diff --git a/trustchain-http/tests/attestation.rs b/crates/trustchain-http/tests/attestation.rs similarity index 90% rename from trustchain-http/tests/attestation.rs rename to crates/trustchain-http/tests/attestation.rs index c671a23c..310655b0 100644 --- a/trustchain-http/tests/attestation.rs +++ b/crates/trustchain-http/tests/attestation.rs @@ -1,4 +1,6 @@ -/// Integration test for attestation challenge-response process. +//! Integration test for attestation challenge-response process. +use port_check::is_port_reachable; +use tokio::runtime::Runtime; use trustchain_core::verifier::Verifier; use trustchain_http::attestation_encryption_utils::{josekit_to_ssi_jwk, ssi_to_josekit_jwk}; use trustchain_http::attestation_utils::{ @@ -6,24 +8,49 @@ use trustchain_http::attestation_utils::{ IdentityCRInitiation, }; use trustchain_http::attestor::present_identity_challenge; +use trustchain_http::config::HTTPConfig; use trustchain_http::requester::{ identity_response, initiate_content_challenge, initiate_identity_challenge, }; -use trustchain_http::utils::init_http; use trustchain_ion::{trustchain_resolver, verifier::TrustchainVerifier}; // The root event time of DID documents used in integration test below. const ROOT_EVENT_TIME_1: u64 = 1666265405; use mockall::automock; -use trustchain_core::utils::extract_keys; +use trustchain_core::utils::{extract_keys, init}; #[automock] pub trait AttestationUtils { fn attestation_request_path(&self) -> String; } +fn init_http() { + init(); + assert!( + !is_port_reachable("127.0.0.1:8081"), + "Port 8081 is required for Challenge-Response integration test but 8081 is already in use." + ); + let http_config = HTTPConfig { + host: "127.0.0.1".parse().unwrap(), + port: 8081, + server_did: Some("did:ion:test:EiBVpjUxXeSRJpvj2TewlX9zNF3GKMCKWwGmKBZqF6pk_A".to_owned()), + root_event_time: Some(1666265405), + ..Default::default() + }; + + // Run test server in own thread + std::thread::spawn(|| { + let rt = Runtime::new().unwrap(); + rt.block_on(async { + trustchain_http::server::http_server(http_config) + .await + .unwrap(); + }); + }); +} + #[tokio::test] #[ignore] async fn attestation_challenge_response() { diff --git a/crates/trustchain-ion/Cargo.toml b/crates/trustchain-ion/Cargo.toml new file mode 100644 index 00000000..9f570cf6 --- /dev/null +++ b/crates/trustchain-ion/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "trustchain-ion" +version = "0.2.0" +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "Trustchain implementation for ION DID method." + +[dependencies] +anyhow = { workspace = true } +async-trait = { workspace = true } +bip39 = { workspace = true } +bitcoin = { workspace = true } +bitcoincore-rpc = { workspace = true } +chrono = { workspace = true } +did-ion = { workspace = true } +ed25519-dalek-bip32 = { workspace = true } +flate2 = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +ipfs-api-backend-hyper = { workspace = true, features = ["with-send-sync"] } +ipfs-hasher = { workspace = true } +k256 = { workspace = true } +lazy_static = { workspace = true } +mongodb = { workspace = true } +reqwest = { workspace = true } +secp256k1 = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +sha2 = { workspace = true } +ssi = { workspace = true, features = ["http-did", "secp256k1"] } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full"] } +toml = { workspace = true } +trustchain-core = { path = "../trustchain-core" } + +[dev-dependencies] +glob = { workspace = true } +itertools = { workspace = true } +mockall = { workspace = true } diff --git a/trustchain-ion/src/attest.rs b/crates/trustchain-ion/src/attest.rs similarity index 100% rename from trustchain-ion/src/attest.rs rename to crates/trustchain-ion/src/attest.rs diff --git a/trustchain-ion/src/attestor.rs b/crates/trustchain-ion/src/attestor.rs similarity index 100% rename from trustchain-ion/src/attestor.rs rename to crates/trustchain-ion/src/attestor.rs diff --git a/trustchain-ion/src/commitment.rs b/crates/trustchain-ion/src/commitment.rs similarity index 100% rename from trustchain-ion/src/commitment.rs rename to crates/trustchain-ion/src/commitment.rs diff --git a/trustchain-ion/src/config.rs b/crates/trustchain-ion/src/config.rs similarity index 100% rename from trustchain-ion/src/config.rs rename to crates/trustchain-ion/src/config.rs diff --git a/trustchain-ion/src/controller.rs b/crates/trustchain-ion/src/controller.rs similarity index 100% rename from trustchain-ion/src/controller.rs rename to crates/trustchain-ion/src/controller.rs diff --git a/trustchain-ion/src/create.rs b/crates/trustchain-ion/src/create.rs similarity index 100% rename from trustchain-ion/src/create.rs rename to crates/trustchain-ion/src/create.rs diff --git a/trustchain-ion/src/data.rs b/crates/trustchain-ion/src/data.rs similarity index 100% rename from trustchain-ion/src/data.rs rename to crates/trustchain-ion/src/data.rs diff --git a/trustchain-ion/src/ion.rs b/crates/trustchain-ion/src/ion.rs similarity index 100% rename from trustchain-ion/src/ion.rs rename to crates/trustchain-ion/src/ion.rs diff --git a/trustchain-ion/src/lib.rs b/crates/trustchain-ion/src/lib.rs similarity index 100% rename from trustchain-ion/src/lib.rs rename to crates/trustchain-ion/src/lib.rs diff --git a/trustchain-ion/src/mnemonic.rs b/crates/trustchain-ion/src/mnemonic.rs similarity index 100% rename from trustchain-ion/src/mnemonic.rs rename to crates/trustchain-ion/src/mnemonic.rs diff --git a/trustchain-ion/src/resolver.rs b/crates/trustchain-ion/src/resolver.rs similarity index 100% rename from trustchain-ion/src/resolver.rs rename to crates/trustchain-ion/src/resolver.rs diff --git a/trustchain-ion/src/root.rs b/crates/trustchain-ion/src/root.rs similarity index 100% rename from trustchain-ion/src/root.rs rename to crates/trustchain-ion/src/root.rs diff --git a/trustchain-ion/src/sidetree.rs b/crates/trustchain-ion/src/sidetree.rs similarity index 100% rename from trustchain-ion/src/sidetree.rs rename to crates/trustchain-ion/src/sidetree.rs diff --git a/trustchain-ion/src/utils.rs b/crates/trustchain-ion/src/utils.rs similarity index 100% rename from trustchain-ion/src/utils.rs rename to crates/trustchain-ion/src/utils.rs diff --git a/trustchain-ion/src/verifier.rs b/crates/trustchain-ion/src/verifier.rs similarity index 100% rename from trustchain-ion/src/verifier.rs rename to crates/trustchain-ion/src/verifier.rs diff --git a/trustchain-ion/tests/config.rs b/crates/trustchain-ion/tests/config.rs similarity index 100% rename from trustchain-ion/tests/config.rs rename to crates/trustchain-ion/tests/config.rs diff --git a/trustchain-ion/tests/display.rs b/crates/trustchain-ion/tests/display.rs similarity index 100% rename from trustchain-ion/tests/display.rs rename to crates/trustchain-ion/tests/display.rs diff --git a/trustchain-ion/tests/resolver.rs b/crates/trustchain-ion/tests/resolver.rs similarity index 100% rename from trustchain-ion/tests/resolver.rs rename to crates/trustchain-ion/tests/resolver.rs diff --git a/trustchain-ion/tests/verifier.rs b/crates/trustchain-ion/tests/verifier.rs similarity index 100% rename from trustchain-ion/tests/verifier.rs rename to crates/trustchain-ion/tests/verifier.rs diff --git a/trustchain-ion/tests/web.rs b/crates/trustchain-ion/tests/web.rs similarity index 100% rename from trustchain-ion/tests/web.rs rename to crates/trustchain-ion/tests/web.rs diff --git a/docs/dev-guide.md b/docs/dev-guide.md index 4e1b20e9..061c1b10 100644 --- a/docs/dev-guide.md +++ b/docs/dev-guide.md @@ -113,7 +113,7 @@ Where required, configurable variables within crates are managed according to th ### trustchain-cli Install with: ```bash -cargo install --path trustchain-cli +cargo install --path crates/trustchain-cli ``` @@ -308,7 +308,7 @@ rsync -azvuv --prune-empty-dirs \ ##### Running the HTTP server on the VM over https - Go trustchain repo, install from branch you would like to serve: ``` -cargo install --path trustchain-http +cargo install --path crates/trustchain-http ``` - Allow the binary to access 443 without sudo: ``` diff --git a/docs/getting-started.md b/docs/getting-started.md index 401698bd..b4bae601 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -91,7 +91,7 @@ $ cargo build Finally, we install the Trustchain command line interface (CLI): ```console -$ cargo install --path trustchain-cli +$ cargo install --path crates/trustchain-cli ``` !!! info "Trustchain HTTP server (this step is optional)" @@ -100,7 +100,7 @@ $ cargo install --path trustchain-cli To install the Trustchain HTTP server, run: ```console - $ cargo install --path trustchain-http + $ cargo install --path crates/trustchain-http ``` ## Configuration diff --git a/src/lib.rs b/src/lib.rs index d2f4749f..4fcb6ad0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,9 @@ pub use trustchain_api as api; pub use trustchain_core as core; +#[cfg(feature = "ffi")] pub use trustchain_ffi as ffi; +#[cfg(feature = "http")] pub use trustchain_http as http; +#[cfg(feature = "ion")] pub use trustchain_ion as ion; diff --git a/trustchain-api/Cargo.toml b/trustchain-api/Cargo.toml deleted file mode 100644 index 9d249723..00000000 --- a/trustchain-api/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "trustchain-api" -version = "0.1.0" -authors = ["Trustchain Devs"] -edition = "2021" - - -[dependencies] -trustchain-core = { path = "../trustchain-core" } -trustchain-ion = { path = "../trustchain-ion" } -async-trait = "0.1" -chrono = "0.4" -serde_json = "1.0" -sha2 = "0.10.7" -ssi = { version = "0.7", features = ["http-did", "secp256k1"] } -did-ion = { version = "0.2" } -futures = "0.3.28" -hex = "0.4.3" - -[dev-dependencies] -tokio = { version = "1.20.1", features = ["full"] } diff --git a/trustchain-cli/Cargo.toml b/trustchain-cli/Cargo.toml deleted file mode 100644 index c693a471..00000000 --- a/trustchain-cli/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "trustchain-cli" -version = "0.1.0" -authors = ["Trustchain Devs"] -edition = "2021" - -[[bin]] -name = "trustchain-cli" -path = "src/bin/main.rs" - -[dependencies] -trustchain-core = { path = "../trustchain-core" } -trustchain-ion = { path = "../trustchain-ion" } -trustchain-api = { path = "../trustchain-api" } -trustchain-http = { path = "../trustchain-http" } - - -clap = { version = "4.0.32", features = ["derive", "cargo"] } -did-ion = { version = "0.2" } -josekit = "0.8" -lazy_static = "1.4.0" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -ssi = { version = "0.7", features = ["http-did", "secp256k1"] } -tokio = { version = "1.20.1", features = ["full"] } -toml = "0.7.2" diff --git a/trustchain-core/Cargo.toml b/trustchain-core/Cargo.toml deleted file mode 100644 index 70eaa175..00000000 --- a/trustchain-core/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "trustchain-core" -version = "0.2.0" -authors = ["Trustchain Devs"] -edition = "2021" - -[dependencies] -async-trait = "0.1" -base64 = "0.13" -canonical_json = "0.4.0" -chrono = "0.4" -did-method-key = { version = "0.2.2"} -futures = "0.3.21" -petgraph = { version = "0.6" } -serde = { version = "1.0", features = ["derive"] } -serde_jcs = "0.1.0" -serde_json = "1.0" -sha2 = "0.10.7" -ssi = { version = "0.7", features = ["http-did", "secp256k1"]} -tempfile = { version = "3.3" } -thiserror = "1.0" -tokio = { version = "1.20.1", features = ["full"] } - -[dev-dependencies] -mockall = "0.11.2" diff --git a/trustchain-ffi/Cargo.toml b/trustchain-ffi/Cargo.toml deleted file mode 100644 index 43310a24..00000000 --- a/trustchain-ffi/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -[package] -name = "trustchain-ffi" -version = "0.1.0" -authors = ["Trustchain Devs"] -edition = "2021" - -[lib] -crate-type = ["cdylib", "staticlib", "lib"] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -trustchain-core = { path = "../trustchain-core" } -trustchain-ion = { path = "../trustchain-ion" } -trustchain-api = { path = "../trustchain-api" } -trustchain-http = { path = "../trustchain-http" } - -anyhow = "1.0" -chrono = "0.4.26" -did-ion = { version = "0.2"} -# Fixed to same version used to generate bridge: `flutter_rust_bridge_codegen@1.64.0` -flutter_rust_bridge = "=1.64.0" -lazy_static = "1.4.0" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -ssi = { version = "0.7", features = ["http-did", "secp256k1"]} -thiserror = "1.0" -tokio = { version = "1.14.0", features = ["rt-multi-thread"] } -toml = "0.7.2" diff --git a/trustchain-http/Cargo.toml b/trustchain-http/Cargo.toml deleted file mode 100644 index 0b716484..00000000 --- a/trustchain-http/Cargo.toml +++ /dev/null @@ -1,57 +0,0 @@ -[package] -name = "trustchain-http" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - - -[[bin]] -name = "trustchain-http" -path = "src/bin/main.rs" - -[dependencies] -trustchain-core = { path = "../trustchain-core" } -trustchain-ion = { path = "../trustchain-ion" } -trustchain-api = { path = "../trustchain-api" } - -async-trait = "0.1" -axum = "0.6" -axum-server = { version = "0.5.1", features = ["tls-rustls"] } -base64 = "0.21.0" -chrono = "^0.4" -clap = { version = "^4", features = ["derive", "env", "cargo"] } -did-ion = { version = "0.2"} -execute = "0.2.11" -gloo-console = "0.2.3" -hex = "0.4.3" -hyper = "0.14.26" -image = "0.23.14" -is_empty = "0.2.0" -josekit = "0.8" -lazy_static = "1.4.0" -log = "0.4" -qrcode = "0.12.0" -rand = "0.8" -reqwest = { version = "0.11.16", features = ["stream"] } -serde = { version = "1.0", features = ["derive"] } -serde_jcs = "0.1.0" -serde_json = "1.0" -# sha2 = "0.10" -shellexpand = "3.1.0" -ssi = { version = "0.7", features = ["http-did", "secp256k1"]} -thiserror = "1.0" -tokio = { version = "1.20.1", features = ["full"] } -tower = "0.4" -tower-http = { version = "0.4.0", features = ["map-request-body", "util"] } -toml = "0.7.2" -tracing = "0.1" -tracing-subscriber = "0.3" -serde_with = "3.4.0" -uuid = { version = "1.2.2", features = ["v4", "fast-rng", "macro-diagnostics"] } - -[dev-dependencies] -axum-test-helper = "0.2.0" -itertools = "0.13.0" -mockall = "0.11.4" -tempfile = "3.9.0" diff --git a/trustchain-http/src/utils.rs b/trustchain-http/src/utils.rs deleted file mode 100644 index 6e29f52a..00000000 --- a/trustchain-http/src/utils.rs +++ /dev/null @@ -1,28 +0,0 @@ -use crate::config::HTTPConfig; -use std::sync::Once; -use tokio::runtime::Runtime; -use trustchain_core::utils::init; - -static INIT_HTTP: Once = Once::new(); -pub fn init_http() { - INIT_HTTP.call_once(|| { - init(); - let http_config = HTTPConfig { - host: "127.0.0.1".parse().unwrap(), - port: 8081, - server_did: Some( - "did:ion:test:EiBVpjUxXeSRJpvj2TewlX9zNF3GKMCKWwGmKBZqF6pk_A".to_owned(), - ), - root_event_time: Some(1666265405), - ..Default::default() - }; - - // Run test server in own thread - std::thread::spawn(|| { - let rt = Runtime::new().unwrap(); - rt.block_on(async { - crate::server::http_server(http_config).await.unwrap(); - }); - }); - }); -} diff --git a/trustchain-ion/Cargo.toml b/trustchain-ion/Cargo.toml deleted file mode 100644 index cdf392e8..00000000 --- a/trustchain-ion/Cargo.toml +++ /dev/null @@ -1,43 +0,0 @@ -[package] -name = "trustchain-ion" -version = "0.2.0" -authors = ["Trustchain Devs"] -edition = "2021" - - -[dependencies] -flutter_rust_bridge = "1" -trustchain-core = { path = "../trustchain-core" } -anyhow = "1.0" -async-trait = "0.1" -bip39 = "2.0.0" -bitcoin = "0.29.2" -bitcoincore-rpc = "0.16.0" -canonical_json = "0.4.0" -chrono = "0.4" -clap = { version = "^4.1", features = ["derive", "cargo"] } -did-ion = { version = "0.2"} -ed25519-dalek-bip32 = "0.3.0" -flate2 = "1.0.24" -futures = "0.3.21" -hex = "0.4.3" -ipfs-api-backend-hyper = { version = "0.6", features = ["with-send-sync"] } -ipfs-hasher = "0.13.0" -k256 = "0.13.1" -lazy_static = "1.4.0" -mongodb = "2.3.1" -reqwest = "0.11" -secp256k1 = "0.27.0" -serde = { version = "1.0", features = ["derive"] } -serde_jcs = "0.1.0" -serde_json = "1.0" -sha2 = "0.10.7" -ssi = { version = "0.7", features = ["http-did", "secp256k1"]} -thiserror = "1.0" -toml = "0.7.2" -tokio = { version = "1.20.1", features = ["full"] } - -[dev-dependencies] -glob = "0.3" -itertools = "0.13.0" -mockall = "0.11.2"