Skip to content

Commit

Permalink
Merge branch 'iotaledger:main' into jwp-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoSvg authored Mar 1, 2024
2 parents 957981e + 28cc8c6 commit affa45a
Show file tree
Hide file tree
Showing 28 changed files with 494 additions and 129 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
cargo metadata --format-version 1 | \
jq -r '.workspace_members[] | select(contains("examples") | not)' | \
jq -r '.workspace_members[]' | \
awk '{print $1}' | \
xargs -I {} cargo check -p {} --no-default-features
- name: Check default features
if: matrix.os == 'ubuntu-latest'
run: |
cargo metadata --format-version 1 | \
jq -r '.workspace_members[] | select(contains("examples") | not)' | \
jq -r '.workspace_members[]' | \
awk '{print $1}' | \
xargs -I {} cargo check -p {}
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
111 changes: 63 additions & 48 deletions bindings/wasm/docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ working with storage backed DID documents.</p>
## Members

<dl>
<dt><a href="#StateMetadataEncoding">StateMetadataEncoding</a></dt>
<dd></dd>
<dt><a href="#MethodRelationship">MethodRelationship</a></dt>
<dd></dd>
<dt><a href="#CredentialStatus">CredentialStatus</a></dt>
<dd></dd>
<dt><a href="#SubjectHolderRelationship">SubjectHolderRelationship</a></dt>
Expand All @@ -207,6 +203,9 @@ This variant is the default.</p>
<dt><a href="#Any">Any</a></dt>
<dd><p>The holder is not required to have any kind of relationship to any credential subject.</p>
</dd>
<dt><a href="#StatusPurpose">StatusPurpose</a></dt>
<dd><p>Purpose of a <a href="#StatusList2021">StatusList2021</a>.</p>
</dd>
<dt><a href="#FailFast">FailFast</a></dt>
<dd><p>Declares when validation should return if an error occurs.</p>
</dd>
Expand All @@ -216,9 +215,6 @@ This variant is the default.</p>
<dt><a href="#FirstError">FirstError</a></dt>
<dd><p>Return after the first error occurs.</p>
</dd>
<dt><a href="#StatusPurpose">StatusPurpose</a></dt>
<dd><p>Purpose of a <a href="#StatusList2021">StatusList2021</a>.</p>
</dd>
<dt><a href="#StatusCheck">StatusCheck</a></dt>
<dd><p>Controls validation behaviour when checking whether or not a credential has been revoked by its
<a href="https://www.w3.org/TR/vc-data-model/#status"><code>credentialStatus</code></a>.</p>
Expand All @@ -236,16 +232,17 @@ This variant is the default.</p>
<dt><a href="#SkipAll">SkipAll</a></dt>
<dd><p>Skip all status checks.</p>
</dd>
<dt><a href="#StateMetadataEncoding">StateMetadataEncoding</a></dt>
<dd></dd>
<dt><a href="#MethodRelationship">MethodRelationship</a></dt>
<dd></dd>
</dl>

## Functions

<dl>
<dt><a href="#encodeB64">encodeB64(data)</a> ⇒ <code>string</code></dt>
<dd><p>Encode the given bytes in url-safe base64.</p>
</dd>
<dt><a href="#decodeB64">decodeB64(data)</a> ⇒ <code>Uint8Array</code></dt>
<dd><p>Decode the given url-safe base64-encoded slice into its raw bytes.</p>
<dt><a href="#start">start()</a></dt>
<dd><p>Initializes the console error panic hook for better error messages</p>
</dd>
<dt><a href="#verifyEd25519">verifyEd25519(alg, signingInput, decodedSignature, publicKey)</a></dt>
<dd><p>Verify a JWS signature secured with the <code>EdDSA</code> algorithm and curve <code>Ed25519</code>.</p>
Expand All @@ -255,8 +252,11 @@ This variant is the default.</p>
<p>This function does not check whether <code>alg = EdDSA</code> in the protected header. Callers are expected to assert this
prior to calling the function.</p>
</dd>
<dt><a href="#start">start()</a></dt>
<dd><p>Initializes the console error panic hook for better error messages</p>
<dt><a href="#encodeB64">encodeB64(data)</a> ⇒ <code>string</code></dt>
<dd><p>Encode the given bytes in url-safe base64.</p>
</dd>
<dt><a href="#decodeB64">decodeB64(data)</a> ⇒ <code>Uint8Array</code></dt>
<dd><p>Decode the given url-safe base64-encoded slice into its raw bytes.</p>
</dd>
</dl>

Expand Down Expand Up @@ -1967,6 +1967,7 @@ if the object is being concurrently modified.
* _instance_
* [.id()](#IotaDocument+id)[<code>IotaDID</code>](#IotaDID)
* [.controller()](#IotaDocument+controller)[<code>Array.&lt;IotaDID&gt;</code>](#IotaDID)
* [.setController(controllers)](#IotaDocument+setController)
* [.alsoKnownAs()](#IotaDocument+alsoKnownAs) ⇒ <code>Array.&lt;string&gt;</code>
* [.setAlsoKnownAs(urls)](#IotaDocument+setAlsoKnownAs)
* [.properties()](#IotaDocument+properties) ⇒ <code>Map.&lt;string, any&gt;</code>
Expand Down Expand Up @@ -2039,6 +2040,20 @@ NOTE: controllers are determined by the `state_controller` unlock condition of t
during resolution and are omitted when publishing.

**Kind**: instance method of [<code>IotaDocument</code>](#IotaDocument)
<a name="IotaDocument+setController"></a>

### iotaDocument.setController(controllers)
Sets the controllers of the document.

Note: Duplicates will be ignored.
Use `null` to remove all controllers.

**Kind**: instance method of [<code>IotaDocument</code>](#IotaDocument)

| Param | Type |
| --- | --- |
| controllers | [<code>CoreDID</code>](#CoreDID) \| [<code>Array.&lt;CoreDID&gt;</code>](#CoreDID) \| <code>null</code> |

<a name="IotaDocument+alsoKnownAs"></a>

### iotaDocument.alsoKnownAs() ⇒ <code>Array.&lt;string&gt;</code>
Expand Down Expand Up @@ -6104,14 +6119,6 @@ Deserializes an instance from a JSON object.
| --- | --- |
| json | <code>any</code> |
<a name="StateMetadataEncoding"></a>
## StateMetadataEncoding
**Kind**: global variable
<a name="MethodRelationship"></a>
## MethodRelationship
**Kind**: global variable
<a name="CredentialStatus"></a>
## CredentialStatus
Expand Down Expand Up @@ -6142,6 +6149,12 @@ The holder must match the subject only for credentials where the [`nonTransferab
## Any
The holder is not required to have any kind of relationship to any credential subject.
**Kind**: global variable
<a name="StatusPurpose"></a>
## StatusPurpose
Purpose of a [StatusList2021](#StatusList2021).
**Kind**: global variable
<a name="FailFast"></a>
Expand All @@ -6160,12 +6173,6 @@ Return all errors that occur during validation.
## FirstError
Return after the first error occurs.
**Kind**: global variable
<a name="StatusPurpose"></a>
## StatusPurpose
Purpose of a [StatusList2021](#StatusList2021).
**Kind**: global variable
<a name="StatusCheck"></a>
Expand Down Expand Up @@ -6198,28 +6205,20 @@ Validate the status if supported, skip any unsupported
Skip all status checks.
**Kind**: global variable
<a name="encodeB64"></a>
## encodeB64(data) ⇒ <code>string</code>
Encode the given bytes in url-safe base64.
**Kind**: global function
<a name="StateMetadataEncoding"></a>
| Param | Type |
| --- | --- |
| data | <code>Uint8Array</code> |
## StateMetadataEncoding
**Kind**: global variable
<a name="MethodRelationship"></a>
<a name="decodeB64"></a>
## MethodRelationship
**Kind**: global variable
<a name="start"></a>
## decodeB64(data) ⇒ <code>Uint8Array</code>
Decode the given url-safe base64-encoded slice into its raw bytes.
## start()
Initializes the console error panic hook for better error messages
**Kind**: global function
| Param | Type |
| --- | --- |
| data | <code>Uint8Array</code> |
<a name="verifyEd25519"></a>
## verifyEd25519(alg, signingInput, decodedSignature, publicKey)
Expand All @@ -6242,9 +6241,25 @@ prior to calling the function.
| decodedSignature | <code>Uint8Array</code> |
| publicKey | [<code>Jwk</code>](#Jwk) |
<a name="start"></a>
<a name="encodeB64"></a>
## start()
Initializes the console error panic hook for better error messages
## encodeB64(data) ⇒ <code>string</code>
Encode the given bytes in url-safe base64.
**Kind**: global function
| Param | Type |
| --- | --- |
| data | <code>Uint8Array</code> |
<a name="decodeB64"></a>
## decodeB64(data) ⇒ <code>Uint8Array</code>
Decode the given url-safe base64-encoded slice into its raw bytes.
**Kind**: global function
| Param | Type |
| --- | --- |
| data | <code>Uint8Array</code> |
20 changes: 20 additions & 0 deletions bindings/wasm/src/iota/iota_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ use std::rc::Rc;

use identity_iota::core::Object;
use identity_iota::core::OneOrMany;

use identity_iota::core::OrderedSet;
use identity_iota::core::Timestamp;
use identity_iota::core::Url;
use identity_iota::credential::Credential;
use identity_iota::credential::JwtPresentationOptions;
use identity_iota::credential::Presentation;

use identity_iota::did::DIDUrl;
use identity_iota::iota::block::output::dto::AliasOutputDto;
use identity_iota::iota::block::output::AliasOutput;
Expand Down Expand Up @@ -48,6 +50,7 @@ use crate::credential::WasmJws;
use crate::credential::WasmJwt;
use crate::credential::WasmPresentation;
use crate::did::CoreDocumentLock;

use crate::did::PromiseJws;
use crate::did::PromiseJwt;
use crate::did::WasmCoreDocument;
Expand Down Expand Up @@ -156,6 +159,20 @@ impl WasmIotaDocument {
)
}

/// Sets the controllers of the document.
///
/// Note: Duplicates will be ignored.
/// Use `null` to remove all controllers.
#[wasm_bindgen(js_name = setController)]
pub fn set_controller(&mut self, controller: &OptionArrayIotaDID) -> Result<()> {
let controller: Option<Vec<IotaDID>> = controller.into_serde().wasm_result()?;
match controller {
Some(controller) => self.0.try_write()?.set_controller(controller),
None => self.0.try_write()?.set_controller([]),
};
Ok(())
}

/// Returns a copy of the document's `alsoKnownAs` set.
#[wasm_bindgen(js_name = alsoKnownAs)]
pub fn also_known_as(&self) -> Result<ArrayString> {
Expand Down Expand Up @@ -845,6 +862,9 @@ impl From<IotaDocument> for WasmIotaDocument {

#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(typescript_type = "IotaDID[] | null")]
pub type OptionArrayIotaDID;

#[wasm_bindgen(typescript_type = "IotaDID[]")]
pub type ArrayIotaDID;

Expand Down
4 changes: 2 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "examples"
version = "1.1.0"
version = "1.1.1"
authors = ["IOTA Stiftung"]
edition = "2021"
publish = false

[dependencies]
anyhow = "1.0.62"
identity_eddsa_verifier = { path = "../identity_eddsa_verifier", default-features = false }
identity_iota = { path = "../identity_iota", default-features = false, features = ["memstore", "domain-linkage", "revocation-bitmap", "status-list-2021"] }
identity_iota = { path = "../identity_iota", default-features = false, features = ["iota-client", "client", "memstore", "domain-linkage", "revocation-bitmap", "status-list-2021"] }
identity_stronghold = { path = "../identity_stronghold", default-features = false }
iota-sdk = { version = "1.0", default-features = false, features = ["tls", "client", "stronghold"] }
json-proof-token.workspace = true
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.1.0"
version = "1.1.1"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand Down
10 changes: 5 additions & 5 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.1.0"
version = "1.1.1"
authors = ["IOTA Stiftung"]
edition = "2021"
homepage.workspace = true
Expand All @@ -14,10 +14,10 @@ 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"] }
Expand Down
4 changes: 2 additions & 2 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.1.0"
version = "1.1.1"
authors.workspace = true
edition = "2021"
homepage.workspace = true
Expand All @@ -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
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.1.0"
version = "1.1.1"
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 = { 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
Expand Down
Loading

0 comments on commit affa45a

Please sign in to comment.