From 5aea90ce3662e9685147b00928603995b16d20ba Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Wed, 14 Feb 2024 17:42:03 +0100 Subject: [PATCH 01/12] Support multiple IOTA network in the Resolver --- identity_resolver/src/error.rs | 3 ++ identity_resolver/src/resolution/resolver.rs | 53 ++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/identity_resolver/src/error.rs b/identity_resolver/src/error.rs index 5a8c3c63f4..a319fb26e8 100644 --- a/identity_resolver/src/error.rs +++ b/identity_resolver/src/error.rs @@ -68,4 +68,7 @@ pub enum ErrorCause { /// The method that is unsupported. method: String, }, + /// No client attached to the specific network. + #[error("none of the attached clients support the netowk {0}")] + UnsupportedNetowrk(String), } diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index 10d5359db8..98b148c567 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -249,6 +249,8 @@ impl Resolver> { #[cfg(feature = "iota")] mod iota_handler { + use crate::ErrorCause; + use super::Resolver; use identity_document::document::CoreDocument; use identity_iota_core::IotaClientExt; @@ -277,6 +279,57 @@ mod iota_handler { self.attach_handler(IotaDID::METHOD.to_owned(), handler); } + + /// Convenience method for attaching multiple handlers responsible for resolving IOTA DIDs + /// on multiple networks. + /// + /// + /// # Arguments + /// + /// * `clients` - A vector of tuples where each tuple contains the name of the network name and its corresponding + /// client. + /// + /// # Examples + /// + /// ``` + /// // Assume `smr_client` and `iota_client` are instances IOTA clients `iota_sdk::client::Client`. + /// attach_multiple_iota_handlers(vec![("smr", smr_client), ("iota", iota_client)]); + /// ``` + /// + /// # See Also + /// - [`attach_handler`](Self::attach_handler). + /// + /// # Note + /// + /// Using `attach_iota_handler` or `attach_handler` for the IOTA method would override all + /// clients added in this method. + pub fn attach_multiple_iota_handlers(&mut self, clients: Vec<(&'static str, CLI)>) + where + CLI: IotaClientExt + Send + Sync + 'static, + { + let arc_clients: Arc> = Arc::new(clients); + + let handler = move |did: IotaDID| { + let future_client = arc_clients.clone(); + async move { + let did_network = did.network_str(); + let client: &CLI = future_client + .as_ref() + .iter() + .find(|(netowrk, _)| *netowrk == did_network) + .map(|(_, client)| client) + .ok_or(crate::Error::new(ErrorCause::UnsupportedNetowrk( + did_network.to_string(), + )))?; + client + .resolve_did(&did) + .await + .map_err(|err| crate::Error::new(ErrorCause::HandlerError { source: Box::new(err) })) + } + }; + + self.attach_handler(IotaDID::METHOD.to_owned(), handler); + } } } From c6b950ff4d711342f340a38200f275aaf376c01e Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Wed, 14 Feb 2024 18:23:58 +0100 Subject: [PATCH 02/12] opt out doc test --- identity_resolver/src/resolution/resolver.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index 98b148c567..f2a26dd391 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -291,7 +291,7 @@ mod iota_handler { /// /// # Examples /// - /// ``` + /// ```no_run /// // Assume `smr_client` and `iota_client` are instances IOTA clients `iota_sdk::client::Client`. /// attach_multiple_iota_handlers(vec![("smr", smr_client), ("iota", iota_client)]); /// ``` From 245003a194661da8935b5fccb419a4a8e14665dc Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Wed, 14 Feb 2024 20:06:59 +0100 Subject: [PATCH 03/12] fix doc test --- identity_resolver/src/resolution/resolver.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index f2a26dd391..78993070df 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -291,7 +291,7 @@ mod iota_handler { /// /// # Examples /// - /// ```no_run + /// ```ignore /// // Assume `smr_client` and `iota_client` are instances IOTA clients `iota_sdk::client::Client`. /// attach_multiple_iota_handlers(vec![("smr", smr_client), ("iota", iota_client)]); /// ``` From faccd7f20d5017e3c86cf0f0c31652089dae5391 Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Fri, 16 Feb 2024 12:22:53 +0100 Subject: [PATCH 04/12] fix typo --- identity_resolver/src/error.rs | 4 ++-- identity_resolver/src/resolution/resolver.rs | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/identity_resolver/src/error.rs b/identity_resolver/src/error.rs index a319fb26e8..d72a78fd4a 100644 --- a/identity_resolver/src/error.rs +++ b/identity_resolver/src/error.rs @@ -69,6 +69,6 @@ pub enum ErrorCause { method: String, }, /// No client attached to the specific network. - #[error("none of the attached clients support the netowk {0}")] - UnsupportedNetowrk(String), + #[error("none of the attached clients support the network {0}")] + UnsupportedNetwork(String), } diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index 78993070df..30aa75f16a 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -286,7 +286,7 @@ mod iota_handler { /// /// # Arguments /// - /// * `clients` - A vector of tuples where each tuple contains the name of the network name and its corresponding + /// * `clients` - A collection of tuples where each tuple contains the name of the network name and its corresponding /// client. /// /// # Examples @@ -301,8 +301,11 @@ mod iota_handler { /// /// # Note /// - /// Using `attach_iota_handler` or `attach_handler` for the IOTA method would override all + /// - Using `attach_iota_handler` or `attach_handler` for the IOTA method would override all /// clients added in this method. + /// - This function does not validate the provided configuration. Ensure that the provided + /// network name corresponds with the client, possibly by using `client.network_name()`. + /// pub fn attach_multiple_iota_handlers(&mut self, clients: Vec<(&'static str, CLI)>) where CLI: IotaClientExt + Send + Sync + 'static, @@ -316,9 +319,9 @@ mod iota_handler { let client: &CLI = future_client .as_ref() .iter() - .find(|(netowrk, _)| *netowrk == did_network) + .find(|(network, _)| *network == did_network) .map(|(_, client)| client) - .ok_or(crate::Error::new(ErrorCause::UnsupportedNetowrk( + .ok_or(crate::Error::new(ErrorCause::UnsupportedNetwork( did_network.to_string(), )))?; client From e664a402dbb952d4a0c8cbbc643d7c2bb3316a33 Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Fri, 16 Feb 2024 12:23:09 +0100 Subject: [PATCH 05/12] fmt --- identity_resolver/src/resolution/resolver.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index 30aa75f16a..e7506e00a0 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -286,8 +286,8 @@ mod iota_handler { /// /// # Arguments /// - /// * `clients` - A collection of tuples where each tuple contains the name of the network name and its corresponding - /// client. + /// * `clients` - A collection of tuples where each tuple contains the name of the network name and its + /// corresponding client. /// /// # Examples /// @@ -305,7 +305,6 @@ mod iota_handler { /// clients added in this method. /// - This function does not validate the provided configuration. Ensure that the provided /// network name corresponds with the client, possibly by using `client.network_name()`. - /// pub fn attach_multiple_iota_handlers(&mut self, clients: Vec<(&'static str, CLI)>) where CLI: IotaClientExt + Send + Sync + 'static, From fb1b4f4039844309a1b20acff60f1f7441640b0f Mon Sep 17 00:00:00 2001 From: Enrico Marconi <31142849+UMR1352@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:08:51 +0100 Subject: [PATCH 06/12] dummy client (#1310) --- identity_iota_core/Cargo.toml | 4 +- .../src/client/identity_client.rs | 5 ++ identity_resolver/Cargo.toml | 2 + identity_resolver/src/resolution/resolver.rs | 87 ++++++++++++++++++- 4 files changed, 94 insertions(+), 4 deletions(-) diff --git a/identity_iota_core/Cargo.toml b/identity_iota_core/Cargo.toml index 6d09722b5e..46541234fc 100644 --- a/identity_iota_core/Cargo.toml +++ b/identity_iota_core/Cargo.toml @@ -45,9 +45,11 @@ rustdoc-args = ["--cfg", "docsrs"] default = ["client", "iota-client", "revocation-bitmap", "send-sync-client-ext"] # Exposes the IotaIdentityClient and IotaIdentityClientExt traits. client = ["dep:async-trait", "iota-sdk"] -# Enbales the implementation of the extension traits on the iota-sdk's Client. +# Enables the implementation of the extension traits on the iota-sdk's Client. iota-client = ["client", "iota-sdk/client", "iota-sdk/tls"] # Enables revocation with `RevocationBitmap2022`. revocation-bitmap = ["identity_credential/revocation-bitmap"] # Adds Send bounds on the futures produces by the client extension traits. send-sync-client-ext = [] +# Disables the blanket implementation of `IotaIdentityClientExt`. +test = ["client"] diff --git a/identity_iota_core/src/client/identity_client.rs b/identity_iota_core/src/client/identity_client.rs index 94b0cf88b2..8706739da8 100644 --- a/identity_iota_core/src/client/identity_client.rs +++ b/identity_iota_core/src/client/identity_client.rs @@ -1,6 +1,8 @@ // Copyright 2020-2023 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use iota_sdk::client::Client; + use crate::block::protocol::ProtocolParameters; use crate::block::address::Address; @@ -192,7 +194,10 @@ pub trait IotaIdentityClientExt: IotaIdentityClient { } } +#[cfg(not(feature = "test"))] impl IotaIdentityClientExt for T where T: IotaIdentityClient {} +#[cfg(feature = "test")] +impl IotaIdentityClientExt for Client {} pub(super) async fn validate_network(client: &T, did: &IotaDID) -> Result<()> where diff --git a/identity_resolver/Cargo.toml b/identity_resolver/Cargo.toml index 20ec82cd1b..0b674460f3 100644 --- a/identity_resolver/Cargo.toml +++ b/identity_resolver/Cargo.toml @@ -32,6 +32,8 @@ optional = true [dev-dependencies] tokio = { version = "1.29.0", default-features = false, features = ["rt-multi-thread", "macros"] } +identity_iota_core = { version = "=1.1.0", path = "../identity_iota_core", features = ["test"] } +iota-sdk = { version = "1.0.2" } [features] default = ["revocation-bitmap", "iota"] diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index e7506e00a0..3cae7be7b7 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -253,7 +253,6 @@ mod iota_handler { use super::Resolver; use identity_document::document::CoreDocument; - use identity_iota_core::IotaClientExt; use identity_iota_core::IotaDID; use identity_iota_core::IotaDocument; use identity_iota_core::IotaIdentityClientExt; @@ -268,7 +267,7 @@ mod iota_handler { /// See also [`attach_handler`](Self::attach_handler). pub fn attach_iota_handler(&mut self, client: CLI) where - CLI: IotaClientExt + Send + Sync + 'static, + CLI: IotaIdentityClientExt + Send + Sync + 'static, { let arc_client: Arc = Arc::new(client); @@ -307,7 +306,7 @@ mod iota_handler { /// network name corresponds with the client, possibly by using `client.network_name()`. pub fn attach_multiple_iota_handlers(&mut self, clients: Vec<(&'static str, CLI)>) where - CLI: IotaClientExt + Send + Sync + 'static, + CLI: IotaIdentityClientExt + Send + Sync + 'static, { let arc_clients: Arc> = Arc::new(clients); @@ -356,3 +355,85 @@ where .finish() } } + +#[cfg(test)] +mod tests { + use identity_iota_core::block::address::Address; + use identity_iota_core::block::output::AliasId; + use identity_iota_core::block::output::AliasOutput; + use identity_iota_core::block::output::OutputId; + use identity_iota_core::block::protocol::ProtocolParameters; + use identity_iota_core::IotaClientExt; + use identity_iota_core::IotaDID; + use identity_iota_core::IotaDocument; + use identity_iota_core::IotaIdentityClient; + use identity_iota_core::IotaIdentityClientExt; + use iota_sdk::client::secret::SecretManager; + + use super::*; + + struct DummyClient(IotaDocument); + + #[async_trait::async_trait] + impl IotaIdentityClient for DummyClient { + async fn get_alias_output(&self, _id: AliasId) -> identity_iota_core::Result<(OutputId, AliasOutput)> { + todo!() + } + async fn get_protocol_parameters(&self) -> identity_iota_core::Result { + todo!() + } + } + + #[async_trait::async_trait] + impl IotaIdentityClientExt for DummyClient { + async fn resolve_did(&self, did: &IotaDID) -> identity_iota_core::Result { + if self.0.id().as_str() == did.as_str() { + Ok(self.0.clone()) + } else { + Err(identity_iota_core::Error::DIDResolutionError( + iota_sdk::client::error::Error::NoOutput(did.to_string()), + )) + } + } + } + + #[async_trait::async_trait] + impl IotaClientExt for DummyClient { + async fn publish_did_output( + &self, + _secret_manager: &SecretManager, + _alias_output: AliasOutput, + ) -> identity_iota_core::Result { + todo!() + } + async fn delete_did_output( + &self, + _secret_manager: &SecretManager, + _address: Address, + _did: &IotaDID, + ) -> identity_iota_core::Result<()> { + todo!() + } + } + + #[tokio::test] + async fn test_multiple_handlers() { + let did1 = + IotaDID::parse("did:iota:smr:0x0101010101010101010101010101010101010101010101010101010101010101").unwrap(); + let document = IotaDocument::new_with_id(did1.clone()); + let dummy_smr_client = DummyClient(document); + + let did2 = IotaDID::parse("did:iota:0x0101010101010101010101010101010101010101010101010101010101010101").unwrap(); + let document = IotaDocument::new_with_id(did2.clone()); + let dummy_iota_client = DummyClient(document); + + let mut resolver = Resolver::::new(); + resolver.attach_multiple_iota_handlers(vec![("iota", dummy_iota_client), ("smr", dummy_smr_client)]); + + let doc = resolver.resolve(&did1).await.unwrap(); + assert_eq!(doc.id(), &did1); + + let doc = resolver.resolve(&did2).await.unwrap(); + assert_eq!(doc.id(), &did2); + } +} From eebb747db99ec36b883ecf6a8eec2c084e80e7bb Mon Sep 17 00:00:00 2001 From: Enrico Marconi Date: Tue, 20 Feb 2024 11:51:12 +0100 Subject: [PATCH 07/12] use generic structure --- identity_resolver/src/resolution/resolver.rs | 38 +++++--------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index 3cae7be7b7..b6eb034b04 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -304,24 +304,23 @@ mod iota_handler { /// clients added in this method. /// - This function does not validate the provided configuration. Ensure that the provided /// network name corresponds with the client, possibly by using `client.network_name()`. - pub fn attach_multiple_iota_handlers(&mut self, clients: Vec<(&'static str, CLI)>) + pub fn attach_multiple_iota_handlers(&mut self, clients: I) where CLI: IotaIdentityClientExt + Send + Sync + 'static, + I: IntoIterator, { - let arc_clients: Arc> = Arc::new(clients); + let arc_clients = Arc::new(clients.into_iter().collect::>()); let handler = move |did: IotaDID| { let future_client = arc_clients.clone(); async move { let did_network = did.network_str(); - let client: &CLI = future_client - .as_ref() - .iter() - .find(|(network, _)| *network == did_network) - .map(|(_, client)| client) - .ok_or(crate::Error::new(ErrorCause::UnsupportedNetwork( - did_network.to_string(), - )))?; + let client: &CLI = + future_client + .get(did_network) + .ok_or(crate::Error::new(ErrorCause::UnsupportedNetwork( + did_network.to_string(), + )))?; client .resolve_did(&did) .await @@ -397,25 +396,6 @@ mod tests { } } - #[async_trait::async_trait] - impl IotaClientExt for DummyClient { - async fn publish_did_output( - &self, - _secret_manager: &SecretManager, - _alias_output: AliasOutput, - ) -> identity_iota_core::Result { - todo!() - } - async fn delete_did_output( - &self, - _secret_manager: &SecretManager, - _address: Address, - _did: &IotaDID, - ) -> identity_iota_core::Result<()> { - todo!() - } - } - #[tokio::test] async fn test_multiple_handlers() { let did1 = From e1287f9741ec76e7c738e273effe242040d19c3c Mon Sep 17 00:00:00 2001 From: Enrico Marconi Date: Tue, 20 Feb 2024 11:58:02 +0100 Subject: [PATCH 08/12] merge main --- CHANGELOG.md | 10 +++++++++- README.md | 4 ++-- examples/Cargo.toml | 2 +- identity_core/Cargo.toml | 2 +- identity_credential/Cargo.toml | 12 ++++++------ identity_did/Cargo.toml | 4 ++-- identity_document/Cargo.toml | 8 ++++---- identity_eddsa_verifier/Cargo.toml | 4 ++-- identity_iota/Cargo.toml | 18 +++++++++--------- identity_iota/README.md | 4 ++-- identity_iota_core/Cargo.toml | 12 ++++++------ .../src/client/identity_client.rs | 2 +- identity_jose/Cargo.toml | 4 ++-- identity_resolver/Cargo.toml | 14 +++++++------- identity_resolver/src/resolution/resolver.rs | 1 + identity_storage/Cargo.toml | 18 +++++++++--------- identity_stronghold/Cargo.toml | 8 ++++---- identity_verification/Cargo.toml | 8 ++++---- 18 files changed, 72 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7c3937447..94cc55d62b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Changelog -## [v1.1.0](https://github.com/iotaledger/identity.rs/tree/v1.1.0) (2024-02-06) +## [v1.1.1](https://github.com/iotaledger/identity.rs/tree/v1.1.1) (2024-02-19) + +[Full Changelog](https://github.com/iotaledger/identity.rs/compare/v1.1.0...v1.1.1) + +### Patch + +- Fix compilation error caused by the roaring crate [\#1306](https://github.com/iotaledger/identity.rs/pull/1306) + +## [v1.1.0](https://github.com/iotaledger/identity.rs/tree/v1.1.0) (2024-02-07) [Full Changelog](https://github.com/iotaledger/identity.rs/compare/v1.0.0...v1.1.0) diff --git a/README.md b/README.md index 18a90879eb..658479444f 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ If you want to include IOTA Identity in your project, simply add it as a depende ```toml [dependencies] -identity_iota = { version = "1.1.0" } +identity_iota = { version = "1.1.1" } ``` To try out the [examples](https://github.com/iotaledger/identity.rs/blob/HEAD/examples), you can also do this: @@ -85,7 +85,7 @@ version = "1.0.0" edition = "2021" [dependencies] -identity_iota = {version = "1.1.0", features = ["memstore"]} +identity_iota = { version = "1.1.1", features = ["memstore"] } iota-sdk = { version = "1.0.2", default-features = true, features = ["tls", "client", "stronghold"] } tokio = { version = "1", features = ["full"] } anyhow = "1.0.62" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 242dacea88..a9337d6a33 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "examples" -version = "1.1.0" +version = "1.1.1" authors = ["IOTA Stiftung"] edition = "2021" publish = false diff --git a/identity_core/Cargo.toml b/identity_core/Cargo.toml index 17199e528f..120d6dc9be 100644 --- a/identity_core/Cargo.toml +++ b/identity_core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_core" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true diff --git a/identity_credential/Cargo.toml b/identity_credential/Cargo.toml index 491158c1f1..876d5577d5 100644 --- a/identity_credential/Cargo.toml +++ b/identity_credential/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_credential" -version = "1.1.0" +version = "1.1.1" authors = ["IOTA Stiftung"] edition = "2021" homepage.workspace = true @@ -14,15 +14,15 @@ description = "An implementation of the Verifiable Credentials standard." [dependencies] flate2 = { version = "1.0.28", default-features = false, features = ["rust_backend"], optional = true } futures = { version = "0.3", default-features = false, optional = true } -identity_core = { version = "=1.1.0", path = "../identity_core", default-features = false } -identity_did = { version = "=1.1.0", path = "../identity_did", default-features = false } -identity_document = { version = "=1.1.0", path = "../identity_document", default-features = false } -identity_verification = { version = "=1.1.0", path = "../identity_verification", default-features = false } +identity_core = { version = "=1.1.1", path = "../identity_core", default-features = false } +identity_did = { version = "=1.1.1", path = "../identity_did", default-features = false } +identity_document = { version = "=1.1.1", path = "../identity_document", default-features = false } +identity_verification = { version = "=1.1.1", path = "../identity_verification", default-features = false } indexmap = { version = "2.0", default-features = false, features = ["std", "serde"] } itertools = { version = "0.11", default-features = false, features = ["use_std"], optional = true } once_cell = { version = "1.18", default-features = false, features = ["std"] } reqwest = { version = "0.11", default-features = false, features = ["default-tls", "json", "stream"], optional = true } -roaring = { version = "0.10", default-features = false, optional = true } +roaring = { version = "0.10", default-features = false, features = ["std"], optional = true } sd-jwt-payload = { version = "0.2.0", default-features = false, features = ["sha"], optional = true } serde.workspace = true serde-aux = { version = "4.3.1", default-features = false, optional = true } diff --git a/identity_did/Cargo.toml b/identity_did/Cargo.toml index 2668c55b08..bed6f9012a 100644 --- a/identity_did/Cargo.toml +++ b/identity_did/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_did" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition = "2021" homepage.workspace = true @@ -13,7 +13,7 @@ description = "Agnostic implementation of the Decentralized Identifiers (DID) st [dependencies] did_url = { version = "0.1", default-features = false, features = ["std", "serde"] } form_urlencoded = { version = "1.2.0", default-features = false, features = ["alloc"] } -identity_core = { version = "=1.1.0", path = "../identity_core" } +identity_core = { version = "=1.1.1", path = "../identity_core" } serde.workspace = true strum.workspace = true thiserror.workspace = true diff --git a/identity_document/Cargo.toml b/identity_document/Cargo.toml index 2ab23ef7d9..bebbd8f070 100644 --- a/identity_document/Cargo.toml +++ b/identity_document/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_document" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -13,9 +13,9 @@ description = "Method-agnostic implementation of the Decentralized Identifiers ( [dependencies] did_url = { version = "0.1", default-features = false, features = ["std", "serde"] } -identity_core = { version = "=1.1.0", path = "../identity_core" } -identity_did = { version = "=1.1.0", path = "../identity_did" } -identity_verification = { version = "=1.1.0", path = "../identity_verification", default-features = false } +identity_core = { version = "=1.1.1", path = "../identity_core" } +identity_did = { version = "=1.1.1", path = "../identity_did" } +identity_verification = { version = "=1.1.1", path = "../identity_verification", default-features = false } indexmap = { version = "2.0", default-features = false, features = ["std", "serde"] } serde.workspace = true strum.workspace = true diff --git a/identity_eddsa_verifier/Cargo.toml b/identity_eddsa_verifier/Cargo.toml index 516b544af6..257fa5d5a4 100644 --- a/identity_eddsa_verifier/Cargo.toml +++ b/identity_eddsa_verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_eddsa_verifier" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -12,7 +12,7 @@ rust-version.workspace = true description = "JWS EdDSA signature verification for IOTA Identity" [dependencies] -identity_jose = { version = "=1.1.0", path = "../identity_jose", default-features = false } +identity_jose = { version = "=1.1.1", path = "../identity_jose", default-features = false } iota-crypto = { version = "0.23", default-features = false, features = ["std"] } [features] diff --git a/identity_iota/Cargo.toml b/identity_iota/Cargo.toml index fdf4edc9a3..bd5aa25125 100644 --- a/identity_iota/Cargo.toml +++ b/identity_iota/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_iota" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -12,14 +12,14 @@ rust-version.workspace = true description = "Framework for Self-Sovereign Identity with IOTA DID." [dependencies] -identity_core = { version = "=1.1.0", path = "../identity_core", default-features = false } -identity_credential = { version = "=1.1.0", path = "../identity_credential", features = ["validator"], default-features = false } -identity_did = { version = "=1.1.0", path = "../identity_did", default-features = false } -identity_document = { version = "=1.1.0", path = "../identity_document", default-features = false } -identity_iota_core = { version = "=1.1.0", path = "../identity_iota_core", default-features = false } -identity_resolver = { version = "=1.1.0", path = "../identity_resolver", default-features = false, optional = true } -identity_storage = { version = "=1.1.0", path = "../identity_storage", default-features = false, features = ["iota-document"] } -identity_verification = { version = "=1.1.0", path = "../identity_verification", default-features = false } +identity_core = { version = "=1.1.1", path = "../identity_core", default-features = false } +identity_credential = { version = "=1.1.1", path = "../identity_credential", features = ["validator"], default-features = false } +identity_did = { version = "=1.1.1", path = "../identity_did", default-features = false } +identity_document = { version = "=1.1.1", path = "../identity_document", default-features = false } +identity_iota_core = { version = "=1.1.1", path = "../identity_iota_core", default-features = false } +identity_resolver = { version = "=1.1.1", path = "../identity_resolver", default-features = false, optional = true } +identity_storage = { version = "=1.1.1", path = "../identity_storage", default-features = false, features = ["iota-document"] } +identity_verification = { version = "=1.1.1", path = "../identity_verification", default-features = false } [dev-dependencies] anyhow = "1.0.64" diff --git a/identity_iota/README.md b/identity_iota/README.md index 0881e9809b..e210d6e10d 100644 --- a/identity_iota/README.md +++ b/identity_iota/README.md @@ -51,7 +51,7 @@ If you want to include IOTA Identity in your project, simply add it as a depende ```toml [dependencies] -identity_iota = { version = "1.1.0" } +identity_iota = { version = "1.1.1" } ``` To try out the [examples](https://github.com/iotaledger/identity.rs/blob/HEAD/examples), you can also do this: @@ -74,7 +74,7 @@ version = "1.0.0" edition = "2021" [dependencies] -identity_iota = {version = "1.1.0", features = ["memstore"]} +identity_iota = {version = "1.1.1", features = ["memstore"]} iota-sdk = { version = "1.0.2", default-features = true, features = ["tls", "client", "stronghold"] } tokio = { version = "1", features = ["full"] } anyhow = "1.0.62" diff --git a/identity_iota_core/Cargo.toml b/identity_iota_core/Cargo.toml index 46541234fc..c5fbfa1f89 100644 --- a/identity_iota_core/Cargo.toml +++ b/identity_iota_core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_iota_core" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -14,11 +14,11 @@ description = "An IOTA Ledger integration for the IOTA DID Method." [dependencies] async-trait = { version = "0.1.56", default-features = false, optional = true } futures = { version = "0.3", default-features = false } -identity_core = { version = "=1.1.0", path = "../identity_core", default-features = false } -identity_credential = { version = "=1.1.0", path = "../identity_credential", default-features = false, features = ["validator"] } -identity_did = { version = "=1.1.0", path = "../identity_did", default-features = false } -identity_document = { version = "=1.1.0", path = "../identity_document", default-features = false } -identity_verification = { version = "=1.1.0", path = "../identity_verification", default-features = false } +identity_core = { version = "=1.1.1", path = "../identity_core", default-features = false } +identity_credential = { version = "=1.1.1", path = "../identity_credential", default-features = false, features = ["validator"] } +identity_did = { version = "=1.1.1", path = "../identity_did", default-features = false } +identity_document = { version = "=1.1.1", path = "../identity_document", default-features = false } +identity_verification = { version = "=1.1.1", path = "../identity_verification", default-features = false } iota-sdk = { version = "1.0.2", default-features = false, features = ["serde", "std"], optional = true } num-derive = { version = "0.4", default-features = false } num-traits = { version = "0.2", default-features = false, features = ["std"] } diff --git a/identity_iota_core/src/client/identity_client.rs b/identity_iota_core/src/client/identity_client.rs index 8706739da8..b2bdad61ac 100644 --- a/identity_iota_core/src/client/identity_client.rs +++ b/identity_iota_core/src/client/identity_client.rs @@ -1,10 +1,10 @@ // Copyright 2020-2023 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +#[cfg(feature = "test")] use iota_sdk::client::Client; use crate::block::protocol::ProtocolParameters; - use crate::block::address::Address; use crate::block::output::feature::SenderFeature; use crate::block::output::unlock_condition::GovernorAddressUnlockCondition; diff --git a/identity_jose/Cargo.toml b/identity_jose/Cargo.toml index dd961fbe08..aa2a53f13a 100644 --- a/identity_jose/Cargo.toml +++ b/identity_jose/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_jose" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -12,7 +12,7 @@ rust-version.workspace = true description = "A library for JOSE (JSON Object Signing and Encryption)" [dependencies] -identity_core = { version = "=1.1.0", path = "../identity_core", default-features = false } +identity_core = { version = "=1.1.1", path = "../identity_core", default-features = false } iota-crypto = { version = "0.23", default-features = false, features = ["std", "sha"] } serde.workspace = true serde_json = { version = "1.0", default-features = false, features = ["std"] } diff --git a/identity_resolver/Cargo.toml b/identity_resolver/Cargo.toml index 0b674460f3..637125421d 100644 --- a/identity_resolver/Cargo.toml +++ b/identity_resolver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_resolver" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -15,16 +15,16 @@ description = "DID Resolution utilities for the identity.rs library." # This is currently necessary for the ResolutionHandler trait. This can be made an optional dependency if alternative ways of attaching handlers are introduced. async-trait = { version = "0.1", default-features = false } futures = { version = "0.3" } -identity_core = { version = "=1.1.0", path = "../identity_core", default-features = false } -identity_credential = { version = "=1.1.0", path = "../identity_credential", default-features = false, features = ["validator"] } -identity_did = { version = "=1.1.0", path = "../identity_did", default-features = false } -identity_document = { version = "=1.1.0", path = "../identity_document", default-features = false } +identity_core = { version = "=1.1.1", path = "../identity_core", default-features = false } +identity_credential = { version = "=1.1.1", path = "../identity_credential", default-features = false, features = ["validator"] } +identity_did = { version = "=1.1.1", path = "../identity_did", default-features = false } +identity_document = { version = "=1.1.1", path = "../identity_document", default-features = false } serde = { version = "1.0", default-features = false, features = ["std", "derive"] } strum.workspace = true thiserror = { version = "1.0", default-features = false } [dependencies.identity_iota_core] -version = "=1.1.0" +version = "=1.1.1" path = "../identity_iota_core" default-features = false features = ["send-sync-client-ext", "iota-client"] @@ -32,7 +32,7 @@ optional = true [dev-dependencies] tokio = { version = "1.29.0", default-features = false, features = ["rt-multi-thread", "macros"] } -identity_iota_core = { version = "=1.1.0", path = "../identity_iota_core", features = ["test"] } +identity_iota_core = { version = "=1.1.1", path = "../identity_iota_core", features = ["test"] } iota-sdk = { version = "1.0.2" } [features] diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index b6eb034b04..07bc65d674 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -256,6 +256,7 @@ mod iota_handler { use identity_iota_core::IotaDID; use identity_iota_core::IotaDocument; use identity_iota_core::IotaIdentityClientExt; + use std::collections::HashMap; use std::sync::Arc; impl Resolver diff --git a/identity_storage/Cargo.toml b/identity_storage/Cargo.toml index b7b0ce0b26..75086ccab9 100644 --- a/identity_storage/Cargo.toml +++ b/identity_storage/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_storage" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -14,12 +14,12 @@ description = "Abstractions over storage for cryptographic keys used in DID Docu [dependencies] async-trait = { version = "0.1.64", default-features = false } futures = { version = "0.3.27", default-features = false, features = ["async-await"] } -identity_core = { version = "=1.1.0", path = "../identity_core", default-features = false } -identity_credential = { version = "=1.1.0", path = "../identity_credential", default-features = false, features = ["credential", "presentation"] } -identity_did = { version = "=1.1.0", path = "../identity_did", default-features = false } -identity_document = { version = "=1.1.0", path = "../identity_document", default-features = false } -identity_iota_core = { version = "=1.1.0", path = "../identity_iota_core", default-features = false, optional = true } -identity_verification = { version = "=1.1.0", path = "../identity_verification", default_features = false } +identity_core = { version = "=1.1.1", path = "../identity_core", default-features = false } +identity_credential = { version = "=1.1.1", path = "../identity_credential", default-features = false, features = ["credential", "presentation"] } +identity_did = { version = "=1.1.1", path = "../identity_did", default-features = false } +identity_document = { version = "=1.1.1", path = "../identity_document", default-features = false } +identity_iota_core = { version = "=1.1.1", path = "../identity_iota_core", default-features = false, optional = true } +identity_verification = { version = "=1.1.1", path = "../identity_verification", default_features = false } iota-crypto = { version = "0.23", default-features = false, features = ["ed25519"], optional = true } rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"], optional = true } seahash = { version = "4.1.0", default_features = false } @@ -29,8 +29,8 @@ thiserror.workspace = true tokio = { version = "1.29.0", default-features = false, features = ["macros", "sync"], optional = true } [dev-dependencies] -identity_credential = { version = "=1.1.0", path = "../identity_credential", features = ["revocation-bitmap"] } -identity_eddsa_verifier = { version = "=1.1.0", path = "../identity_eddsa_verifier", default-features = false, features = ["ed25519"] } +identity_credential = { version = "=1.1.1", path = "../identity_credential", features = ["revocation-bitmap"] } +identity_eddsa_verifier = { version = "=1.1.1", path = "../identity_eddsa_verifier", default-features = false, features = ["ed25519"] } once_cell = { version = "1.18", default-features = false } tokio = { version = "1.29.0", default-features = false, features = ["macros", "sync", "rt"] } diff --git a/identity_stronghold/Cargo.toml b/identity_stronghold/Cargo.toml index de0197a3ef..e45a6d4eb7 100644 --- a/identity_stronghold/Cargo.toml +++ b/identity_stronghold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_stronghold" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -13,8 +13,8 @@ description = "Secure JWK storage with Stronghold for IOTA Identity" [dependencies] async-trait = { version = "0.1.64", default-features = false } -identity_storage = { version = "=1.1.0", path = "../identity_storage", default_features = false } -identity_verification = { version = "=1.1.0", path = "../identity_verification", default_features = false } +identity_storage = { version = "=1.1.1", path = "../identity_storage", default_features = false } +identity_verification = { version = "=1.1.1", path = "../identity_verification", default_features = false } iota-crypto = { version = "0.23", default-features = false, features = ["ed25519"] } iota-sdk = { version = "1.0.2", default-features = false, features = ["client", "stronghold"] } iota_stronghold = { version = "2.0", default-features = false } @@ -23,7 +23,7 @@ tokio = { version = "1.29.0", default-features = false, features = ["macros", "s zeroize = { version = "1.6.0", default_features = false } [dev-dependencies] -identity_did = { version = "=1.1.0", path = "../identity_did", default_features = false } +identity_did = { version = "=1.1.1", path = "../identity_did", default_features = false } tokio = { version = "1.29.0", default-features = false, features = ["macros", "sync", "rt"] } [features] diff --git a/identity_verification/Cargo.toml b/identity_verification/Cargo.toml index 7d965f60fc..1b6bb11d77 100644 --- a/identity_verification/Cargo.toml +++ b/identity_verification/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identity_verification" -version = "1.1.0" +version = "1.1.1" authors.workspace = true edition.workspace = true homepage.workspace = true @@ -9,9 +9,9 @@ rust-version.workspace = true description = "Verification data types and functionality for identity.rs" [dependencies] -identity_core = { version = "=1.1.0", path = "./../identity_core", default-features = false } -identity_did = { version = "=1.1.0", path = "./../identity_did", default-features = false } -identity_jose = { version = "=1.1.0", path = "./../identity_jose", default-features = false } +identity_core = { version = "=1.1.1", path = "./../identity_core", default-features = false } +identity_did = { version = "=1.1.1", path = "./../identity_did", default-features = false } +identity_jose = { version = "=1.1.1", path = "./../identity_jose", default-features = false } serde.workspace = true strum.workspace = true thiserror.workspace = true From b582676a31c27cdc708aef883e989192c1238998 Mon Sep 17 00:00:00 2001 From: Enrico Marconi Date: Tue, 20 Feb 2024 11:59:03 +0100 Subject: [PATCH 09/12] fmt & clippy --- identity_iota_core/src/client/identity_client.rs | 2 +- identity_resolver/src/resolution/resolver.rs | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/identity_iota_core/src/client/identity_client.rs b/identity_iota_core/src/client/identity_client.rs index b2bdad61ac..34df1fd5f0 100644 --- a/identity_iota_core/src/client/identity_client.rs +++ b/identity_iota_core/src/client/identity_client.rs @@ -4,7 +4,6 @@ #[cfg(feature = "test")] use iota_sdk::client::Client; -use crate::block::protocol::ProtocolParameters; use crate::block::address::Address; use crate::block::output::feature::SenderFeature; use crate::block::output::unlock_condition::GovernorAddressUnlockCondition; @@ -16,6 +15,7 @@ use crate::block::output::Feature; use crate::block::output::OutputId; use crate::block::output::RentStructure; use crate::block::output::UnlockCondition; +use crate::block::protocol::ProtocolParameters; use crate::Error; use crate::IotaDID; use crate::IotaDocument; diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index 07bc65d674..c46f9b4273 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -358,17 +358,14 @@ where #[cfg(test)] mod tests { - use identity_iota_core::block::address::Address; use identity_iota_core::block::output::AliasId; use identity_iota_core::block::output::AliasOutput; use identity_iota_core::block::output::OutputId; use identity_iota_core::block::protocol::ProtocolParameters; - use identity_iota_core::IotaClientExt; use identity_iota_core::IotaDID; use identity_iota_core::IotaDocument; use identity_iota_core::IotaIdentityClient; use identity_iota_core::IotaIdentityClientExt; - use iota_sdk::client::secret::SecretManager; use super::*; From 16b905b53346bc9d2da94d71ce36a9dfd02d4dc3 Mon Sep 17 00:00:00 2001 From: Enrico Marconi Date: Tue, 20 Feb 2024 12:05:05 +0100 Subject: [PATCH 10/12] dprint fmt --- identity_resolver/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/identity_resolver/Cargo.toml b/identity_resolver/Cargo.toml index 637125421d..bd28b248ad 100644 --- a/identity_resolver/Cargo.toml +++ b/identity_resolver/Cargo.toml @@ -31,9 +31,9 @@ features = ["send-sync-client-ext", "iota-client"] optional = true [dev-dependencies] -tokio = { version = "1.29.0", default-features = false, features = ["rt-multi-thread", "macros"] } identity_iota_core = { version = "=1.1.1", path = "../identity_iota_core", features = ["test"] } iota-sdk = { version = "1.0.2" } +tokio = { version = "1.29.0", default-features = false, features = ["rt-multi-thread", "macros"] } [features] default = ["revocation-bitmap", "iota"] From 3aadf33929e0f6669c4ae183f932f43a4ff07e39 Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Tue, 20 Feb 2024 22:08:44 +0100 Subject: [PATCH 11/12] nit --- identity_resolver/src/resolution/resolver.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index c46f9b4273..45c7704472 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -374,10 +374,10 @@ mod tests { #[async_trait::async_trait] impl IotaIdentityClient for DummyClient { async fn get_alias_output(&self, _id: AliasId) -> identity_iota_core::Result<(OutputId, AliasOutput)> { - todo!() + unreachable!() } async fn get_protocol_parameters(&self) -> identity_iota_core::Result { - todo!() + unreachable!() } } From 7ee0a16eb3cd77e171c77ea712d47a5e6ea56d70 Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab <31316147+abdulmth@users.noreply.github.com> Date: Wed, 21 Feb 2024 13:47:39 +0100 Subject: [PATCH 12/12] Update identity_resolver/src/resolution/resolver.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Eike Haß --- identity_resolver/src/resolution/resolver.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/identity_resolver/src/resolution/resolver.rs b/identity_resolver/src/resolution/resolver.rs index 45c7704472..b8ceffbc7f 100644 --- a/identity_resolver/src/resolution/resolver.rs +++ b/identity_resolver/src/resolution/resolver.rs @@ -302,7 +302,7 @@ mod iota_handler { /// # Note /// /// - Using `attach_iota_handler` or `attach_handler` for the IOTA method would override all - /// clients added in this method. + /// previously added clients. /// - This function does not validate the provided configuration. Ensure that the provided /// network name corresponds with the client, possibly by using `client.network_name()`. pub fn attach_multiple_iota_handlers(&mut self, clients: I)