Skip to content

Commit

Permalink
Merge branch 'main' into feat/sd-jwt-vc
Browse files Browse the repository at this point in the history
  • Loading branch information
UMR1352 committed Dec 11, 2024
2 parents 72333bb + 9db4fa6 commit 468809e
Show file tree
Hide file tree
Showing 30 changed files with 298 additions and 86 deletions.
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [v1.4.0](https://github.com/iotaledger/identity.rs/tree/v1.4.0) (2024-09-23)

[Full Changelog](https://github.com/iotaledger/identity.rs/compare/v1.3.1...v1.4.0)

### Added

- Add feature to support custom `now_utc` implementations [\#1397](https://github.com/iotaledger/identity.rs/pull/1397)
- Add support for `did:jwk` resolution [\#1404](https://github.com/iotaledger/identity.rs/pull/1404)
- Linked Verifiable Presentations [\#1398](https://github.com/iotaledger/identity.rs/pull/1398)
- Add support for custom JWS algorithms [\#1410](https://github.com/iotaledger/identity.rs/pull/1410)

### Patch

- Make `bls12_381_plus` dependency more flexible again [\#1393](https://github.com/iotaledger/identity.rs/pull/1393)
- Mark `js-sys` as optional for identity_core [\#1405](https://github.com/iotaledger/identity.rs/pull/1405)
- Remove dependency on `identity_core` default features [\#1408](https://github.com/iotaledger/identity.rs/pull/1408)

## [v1.3.1](https://github.com/iotaledger/identity.rs/tree/v1.3.1) (2024-06-12)

[Full Changelog](https://github.com/iotaledger/identity.rs/compare/v1.3.0...v1.3.1)
Expand All @@ -8,8 +25,6 @@

- Pin and bump `bls12_381_plus` dependency [\#1378](https://github.com/iotaledger/identity.rs/pull/1378)

# Changelog

## [v1.3.0](https://github.com/iotaledger/identity.rs/tree/v1.3.0) (2024-05-28)

[Full Changelog](https://github.com/iotaledger/identity.rs/compare/v1.2.0...v1.3.0)
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

---

> [!NOTE]
> This version of the library is compatible with IOTA Stardust networks, for a version of the library compatible with IOTA Rebased networks check [here](https://github.com/iotaledger/identity.rs/tree/feat/identity-rebased-alpha/)
## Introduction

IOTA Identity is a [Rust](https://www.rust-lang.org/) implementation of decentralized digital identity, also known as Self-Sovereign Identity (SSI). It implements the W3C [Decentralized Identifiers (DID)](https://www.w3.org/TR/did-core/) and [Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) specifications. This library can be used to create, resolve and authenticate digital identities and to create verifiable credentials and presentations in order to share information in a verifiable manner and establish trust in the digital world. It does so while supporting secure storage of cryptographic keys, which can be implemented for your preferred key management system. Many of the individual libraries (Rust crates) are agnostic over the concrete DID method, with the exception of some libraries dedicated to implement the [IOTA DID method](https://wiki.iota.org/identity.rs/specs/did/iota_did_method_spec/), which is an implementation of decentralized digital identity on the IOTA and Shimmer networks. Written in stable Rust, IOTA Identity has strong guarantees of memory safety and process integrity while maintaining exceptional performance.
Expand Down Expand Up @@ -54,7 +57,7 @@ If you want to include IOTA Identity in your project, simply add it as a depende

```toml
[dependencies]
identity_iota = { version = "1.3.1" }
identity_iota = { version = "1.4.0" }
```

To try out the [examples](https://github.com/iotaledger/identity.rs/blob/HEAD/examples), you can also do this:
Expand Down Expand Up @@ -88,7 +91,7 @@ version = "1.0.0"
edition = "2021"

[dependencies]
identity_iota = { version = "1.3.1", features = ["memstore"] }
identity_iota = { version = "1.4.0", features = ["memstore"] }
iota-sdk = { version = "1.0.2", default-features = true, features = ["tls", "client", "stronghold"] }
tokio = { version = "1", features = ["full"] }
anyhow = "1.0.62"
Expand Down
12 changes: 11 additions & 1 deletion bindings/wasm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Changelog

## [wasm-v1.3.1](https://github.com/iotaledger/identity.rs/tree/wasm-v1.3.1) (2024-06-27)
## [wasm-v1.4.0](https://github.com/iotaledger/identity.rs/tree/wasm-v1.4.0) (2024-09-23)

[Full Changelog](https://github.com/iotaledger/identity.rs/compare/wasm-v1.3.1...wasm-v1.4.0)

### Added

- Add support for `did:jwk` resolution [\#1404](https://github.com/iotaledger/identity.rs/pull/1404)
- Linked Verifiable Presentations [\#1398](https://github.com/iotaledger/identity.rs/pull/1398)
- Add WASM bindings for EcDSA JWS Verifier [\#1396](https://github.com/iotaledger/identity.rs/pull/1396)

## [wasm-v1.3.1](https://github.com/iotaledger/identity.rs/tree/wasm-v1.3.1) (2024-06-28)

[Full Changelog](https://github.com/iotaledger/identity.rs/compare/wasm-v1.3.0...wasm-v1.3.1)

Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_wasm"
version = "1.3.1"
version = "1.4.0"
authors = ["IOTA Stiftung"]
edition = "2021"
homepage = "https://www.iota.org"
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iota/identity-wasm",
"version": "1.3.1",
"version": "1.4.0",
"description": "WASM bindings for IOTA Identity - A Self Sovereign Identity Framework implementing the DID and VC standards from W3C. To be used in Javascript/Typescript",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion bindings/wasm/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[toolchain]
channel = "stable"
# @itsyaasir - Update to latest stable version when wasm-bindgen is updated
channel = "1.81"
components = ["rustfmt"]
targets = ["wasm32-unknown-unknown"]
profile = "minimal"
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "examples"
version = "1.3.1"
version = "1.4.0"
authors = ["IOTA Stiftung"]
edition = "2021"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion identity_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_core"
version = "1.3.1"
version = "1.4.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand Down
12 changes: 6 additions & 6 deletions identity_credential/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_credential"
version = "1.3.1"
version = "1.4.0"
authors = ["IOTA Stiftung"]
edition = "2021"
homepage.workspace = true
Expand All @@ -16,11 +16,11 @@ anyhow = { version = "1" }
async-trait = { version = "0.1.64", default-features = false }
bls12_381_plus = { workspace = true, optional = true }
flate2 = { version = "1.0.28", default-features = false, features = ["rust_backend"], optional = true }
futures = { version = "0.3", default-features = false, optional = true, features = ["alloc"] }
identity_core = { version = "=1.3.1", path = "../identity_core", default-features = false }
identity_did = { version = "=1.3.1", path = "../identity_did", default-features = false }
identity_document = { version = "=1.3.1", path = "../identity_document", default-features = false }
identity_verification = { version = "=1.3.1", path = "../identity_verification", default-features = false }
futures = { version = "0.3", default-features = false, optional = true }
identity_core = { version = "=1.4.0", path = "../identity_core", default-features = false }
identity_did = { version = "=1.4.0", path = "../identity_did", default-features = false }
identity_document = { version = "=1.4.0", path = "../identity_document", default-features = false }
identity_verification = { version = "=1.4.0", 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 }
json-proof-token = { workspace = true, optional = true }
Expand Down
22 changes: 21 additions & 1 deletion identity_credential/src/revocation/status_list_2021/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ where
.map(ToOwned::to_owned)
}

/// Serialize usize as string.
fn serialize_number_as_string<S>(value: &usize, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(&value.to_string())
}

/// [StatusList2021Entry](https://www.w3.org/TR/2023/WD-vc-status-list-20230427/#statuslist2021entry) implementation.
#[derive(Debug, Clone, Serialize, Deserialize, Hash, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
Expand All @@ -45,7 +53,10 @@ pub struct StatusList2021Entry {
#[serde(rename = "type", deserialize_with = "deserialize_status_entry_type")]
type_: String,
status_purpose: StatusPurpose,
#[serde(deserialize_with = "serde_aux::prelude::deserialize_number_from_string")]
#[serde(
deserialize_with = "serde_aux::prelude::deserialize_number_from_string",
serialize_with = "serialize_number_as_string"
)]
status_list_index: usize,
status_list_credential: Url,
}
Expand Down Expand Up @@ -142,4 +153,13 @@ mod tests {
});
serde_json::from_value::<StatusList2021Entry>(status).expect("wrong type");
}

#[test]
fn test_status_list_index_serialization() {
let base_url = Url::parse("https://example.com/credentials/status/3").unwrap();

let entry1 = StatusList2021Entry::new(base_url.clone(), StatusPurpose::Revocation, 94567, None);
let json1 = serde_json::to_value(&entry1).unwrap();
assert_eq!(json1["statusListIndex"], "94567");
}
}
6 changes: 3 additions & 3 deletions identity_did/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_did"
version = "1.3.1"
version = "1.4.0"
authors.workspace = true
edition = "2021"
homepage.workspace = true
Expand All @@ -13,8 +13,8 @@ description = "Agnostic implementation of the Decentralized Identifiers (DID) st
[dependencies]
did_url_parser = { version = "0.2.0", features = ["std", "serde"] }
form_urlencoded = { version = "1.2.0", default-features = false, features = ["alloc"] }
identity_core = { version = "=1.3.1", path = "../identity_core", default-features = false }
identity_jose = { version = "=1.3.1", path = "../identity_jose" }
identity_core = { version = "=1.4.0", path = "../identity_core", default-features = false }
identity_jose = { version = "=1.4.0", path = "../identity_jose" }
serde.workspace = true
strum.workspace = true
thiserror.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions identity_document/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_document"
version = "1.3.1"
version = "1.4.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand All @@ -13,9 +13,9 @@ description = "Method-agnostic implementation of the Decentralized Identifiers (

[dependencies]
did_url_parser = { version = "0.2.0", features = ["std", "serde"] }
identity_core = { version = "=1.3.1", path = "../identity_core", default-features = false }
identity_did = { version = "=1.3.1", path = "../identity_did" }
identity_verification = { version = "=1.3.1", path = "../identity_verification", default-features = false }
identity_core = { version = "=1.4.0", path = "../identity_core", default-features = false }
identity_did = { version = "=1.4.0", path = "../identity_did" }
identity_verification = { version = "=1.4.0", path = "../identity_verification", default-features = false }
indexmap = { version = "2.0", default-features = false, features = ["std", "serde"] }
serde.workspace = true
strum.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions identity_ecdsa_verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_ecdsa_verifier"
version = "1.3.1"
version = "1.4.0"
authors = ["IOTA Stiftung", "Filancore GmbH"]
edition.workspace = true
homepage.workspace = true
Expand All @@ -15,7 +15,7 @@ description = "JWS ECDSA signature verification for IOTA Identity"
workspace = true

[dependencies]
identity_verification = { version = "=1.3.1", path = "../identity_verification", default-features = false }
identity_verification = { version = "=1.4.0", path = "../identity_verification", default-features = false }
k256 = { version = "0.13.3", default-features = false, features = ["std", "ecdsa", "ecdsa-core"], optional = true }
p256 = { version = "0.13.2", default-features = false, features = ["std", "ecdsa", "ecdsa-core"], optional = true }
signature = { version = "2", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions identity_eddsa_verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_eddsa_verifier"
version = "1.3.1"
version = "1.4.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand All @@ -12,7 +12,7 @@ rust-version.workspace = true
description = "JWS EdDSA signature verification for IOTA Identity"

[dependencies]
identity_jose = { version = "=1.3.1", path = "../identity_jose", default-features = false }
identity_jose = { version = "=1.4.0", path = "../identity_jose", default-features = false }
iota-crypto = { version = "0.23.2", default-features = false, features = ["std"] }

[features]
Expand Down
18 changes: 9 additions & 9 deletions identity_iota/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_iota"
version = "1.3.1"
version = "1.4.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand All @@ -12,14 +12,14 @@ rust-version.workspace = true
description = "Framework for Self-Sovereign Identity with IOTA DID."

[dependencies]
identity_core = { version = "=1.3.1", path = "../identity_core", default-features = false }
identity_credential = { version = "=1.3.1", path = "../identity_credential", features = ["validator"], default-features = false }
identity_did = { version = "=1.3.1", path = "../identity_did", default-features = false }
identity_document = { version = "=1.3.1", path = "../identity_document", default-features = false }
identity_iota_core = { version = "=1.3.1", path = "../identity_iota_core", default-features = false }
identity_resolver = { version = "=1.3.1", path = "../identity_resolver", default-features = false, optional = true }
identity_storage = { version = "=1.3.1", path = "../identity_storage", default-features = false, features = ["iota-document"] }
identity_verification = { version = "=1.3.1", path = "../identity_verification", default-features = false }
identity_core = { version = "=1.4.0", path = "../identity_core", default-features = false }
identity_credential = { version = "=1.4.0", path = "../identity_credential", features = ["validator"], default-features = false }
identity_did = { version = "=1.4.0", path = "../identity_did", default-features = false }
identity_document = { version = "=1.4.0", path = "../identity_document", default-features = false }
identity_iota_core = { version = "=1.4.0", path = "../identity_iota_core", default-features = false }
identity_resolver = { version = "=1.4.0", path = "../identity_resolver", default-features = false, optional = true }
identity_storage = { version = "=1.4.0", path = "../identity_storage", default-features = false, features = ["iota-document"] }
identity_verification = { version = "=1.4.0", path = "../identity_verification", default-features = false }

[dev-dependencies]
anyhow = "1.0.64"
Expand Down
7 changes: 5 additions & 2 deletions identity_iota/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

---

> [!NOTE]
> This version of the library is compatible with IOTA Stardust networks, for a version of the library compatible with IOTA Rebased networks check [here](https://github.com/iotaledger/identity.rs/tree/feat/identity-rebased-alpha/)
## Introduction

IOTA Identity is a [Rust](https://www.rust-lang.org/) implementation of decentralized digital identity, also known as Self-Sovereign Identity (SSI). It implements the W3C [Decentralized Identifiers (DID)](https://www.w3.org/TR/did-core/) and [Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) specifications. This library can be used to create, resolve and authenticate digital identities and to create verifiable credentials and presentations in order to share information in a verifiable manner and establish trust in the digital world. It does so while supporting secure storage of cryptographic keys, which can be implemented for your preferred key management system. Many of the individual libraries (Rust crates) are agnostic over the concrete DID method, with the exception of some libraries dedicated to implement the [IOTA DID method](https://wiki.iota.org/identity.rs/specs/did/iota_did_method_spec/), which is an implementation of decentralized digital identity on the IOTA and Shimmer networks. Written in stable Rust, IOTA Identity has strong guarantees of memory safety and process integrity while maintaining exceptional performance.
Expand Down Expand Up @@ -54,7 +57,7 @@ If you want to include IOTA Identity in your project, simply add it as a depende

```toml
[dependencies]
identity_iota = { version = "1.3.1" }
identity_iota = { version = "1.4.0" }
```

To try out the [examples](https://github.com/iotaledger/identity.rs/blob/HEAD/examples), you can also do this:
Expand Down Expand Up @@ -88,7 +91,7 @@ version = "1.0.0"
edition = "2021"

[dependencies]
identity_iota = { version = "1.3.1", features = ["memstore"] }
identity_iota = { version = "1.4.0", features = ["memstore"] }
iota-sdk = { version = "1.0.2", default-features = true, features = ["tls", "client", "stronghold"] }
tokio = { version = "1", features = ["full"] }
anyhow = "1.0.62"
Expand Down
12 changes: 6 additions & 6 deletions identity_iota_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_iota_core"
version = "1.3.1"
version = "1.4.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand All @@ -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.3.1", path = "../identity_core", default-features = false }
identity_credential = { version = "=1.3.1", path = "../identity_credential", default-features = false, features = ["validator"] }
identity_did = { version = "=1.3.1", path = "../identity_did", default-features = false }
identity_document = { version = "=1.3.1", path = "../identity_document", default-features = false }
identity_verification = { version = "=1.3.1", path = "../identity_verification", default-features = false }
identity_core = { version = "=1.4.0", path = "../identity_core", default-features = false }
identity_credential = { version = "=1.4.0", path = "../identity_credential", default-features = false, features = ["validator"] }
identity_did = { version = "=1.4.0", path = "../identity_did", default-features = false }
identity_document = { version = "=1.4.0", path = "../identity_document", default-features = false }
identity_verification = { version = "=1.4.0", path = "../identity_verification", default-features = false }
iota-sdk = { version = "1.1.5", 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"] }
Expand Down
11 changes: 9 additions & 2 deletions identity_jose/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "identity_jose"
version = "1.3.1"
version = "1.4.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand All @@ -13,7 +13,7 @@ description = "A library for JOSE (JSON Object Signing and Encryption)"

[dependencies]
bls12_381_plus.workspace = true
identity_core = { version = "=1.3.1", path = "../identity_core" }
identity_core = { version = "=1.4.0", path = "../identity_core" }
iota-crypto = { version = "0.23.2", default-features = false, features = ["std", "sha"] }
json-proof-token.workspace = true
serde.workspace = true
Expand All @@ -34,3 +34,10 @@ test = true

[lints]
workspace = true

[features]
custom_alg = []

[[test]]
name = "custom_alg"
required-features = ["custom_alg"]
4 changes: 2 additions & 2 deletions identity_jose/src/jwk/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ impl Jwk {
// ===========================================================================

/// Checks if the `alg` claim of the JWK is equal to `expected`.
pub fn check_alg(&self, expected: &str) -> Result<()> {
pub fn check_alg(&self, expected: impl AsRef<str>) -> Result<()> {
match self.alg() {
Some(value) if value == expected => Ok(()),
Some(value) if value == expected.as_ref() => Ok(()),
Some(_) => Err(Error::InvalidClaim("alg")),
None => Ok(()),
}
Expand Down
Loading

0 comments on commit 468809e

Please sign in to comment.