Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename crates to use underscores #895

Merged
merged 16 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 10 additions & 10 deletions .github/actions/release/bump-versions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ runs:
command: install
args: -f --no-default-features --features "add set-version" --version ^0.8 cargo-edit

- name: Replace identity version in Wasm bindings
- name: Replace identity_iota version in Wasm bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/wasm
run: |
cargo add identity@=${{ inputs.version }} --path=../../identity
- name: Replace identity version in stronghold nodejs bindings
cargo add identity_iota@=${{ inputs.version }} --path=../../identity_iota

- name: Replace identity versions in stronghold nodejs bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/stronghold-nodejs
run: |
cargo add identity-core@=${{ inputs.version }} --path=../../identity-core
cargo add identity-iota-core@=${{ inputs.version }} --path=../../identity-iota-core
cargo add identity-account-storage@=${{ inputs.version }} --path=../../identity-account-storage
- name: Bump Rust crate version
cargo add identity_core@=${{ inputs.version }} --path=../../identity_core
cargo add identity_iota_core@=${{ inputs.version }} --path=../../identity_iota_core
cargo add identity_account_storage@=${{ inputs.version }} --path=../../identity_account_storage

- name: Bump Rust crate versions
shell: bash
if: ${{inputs.release-target == 'rust'}}
run: |
Expand Down Expand Up @@ -88,4 +88,4 @@ runs:
run: |
npm version ${{ inputs.version }}
# set peer dependency version
echo "`jq '.peerDependencies."@iota/identity-wasm"="${{ inputs.version }}"' package.json`" > package.json
echo "`jq '.peerDependencies."@iota/identity-wasm"="${{ inputs.version }}"' package.json`" > package.json
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[workspace]
resolver = "2"
members = [
"identity",
# "identity-comm",
"identity-account",
"identity-account-storage",
"identity-core",
"identity-credential",
"identity-did",
"identity-diff",
"identity-iota",
"identity-iota-core",
# "identity_comm",
"identity_account",
"identity_account_storage",
"identity_core",
"identity_credential",
"identity_did",
"identity_diff",
cycraig marked this conversation as resolved.
Show resolved Hide resolved
"identity_iota",
"identity_iota_client",
"identity_iota_core",

"examples",
]
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The individual libraries are developed to be agnostic about the utilized [Distri
If you want to include IOTA Identity in your project, simply add it as a dependency in your `Cargo.toml`:
```toml
[dependencies]
identity = { version = "0.6" }
identity_iota = { version = "0.6" }
```

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

[dependencies]
identity = { version = "0.6" }
identity_iota = { version = "0.6" }
tokio = { version = "1", features = ["full"] }
```
*main.*<span></span>*rs*
```rust,no_run
use identity::account::Account;
use identity::account::IdentitySetup;
use identity::account::Result;
use identity::account_storage::Stronghold;
use identity::core::ToJson;
use identity::iota::ExplorerUrl;
use identity::iota::ResolvedIotaDocument;
use identity_iota::account::Account;
use identity_iota::account::IdentitySetup;
use identity_iota::account::Result;
use identity_iota::account_storage::Stronghold;
use identity_iota::core::ToJson;
use identity_iota::client::ExplorerUrl;
use identity_iota::client::ResolvedIotaDocument;

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
6 changes: 3 additions & 3 deletions bindings/stronghold-nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ publish = false
crate-type = ["cdylib"]

[dependencies]
identity-account-storage = { version = "=0.5.0", path = "../../identity-account-storage", default-features = false, features = ["stronghold", "send-sync-storage", "encryption"] }
identity-core = { version = "=0.5.0", path = "../../identity-core", default-features = false }
identity-iota-core = { version = "=0.5.0", path = "../../identity-iota-core", default-features = false }
identity_account_storage = { version = "=0.5.0", path = "../../identity_account_storage", default-features = false, features = ["stronghold", "send-sync-storage", "encryption"] }
identity_core = { version = "=0.5.0", path = "../../identity_core", default-features = false }
identity_iota_core = { version = "=0.5.0", path = "../../identity_iota_core", default-features = false }
napi = { version = "2.4.3", default-features = false, features = ["napi4", "tokio_rt", "serde-json"] }
napi-derive = { version = "2.4.1", default-features = false, features = ["compat-mode", "full"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
Expand Down
8 changes: 4 additions & 4 deletions bindings/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "identity-wasm"
name = "identity_wasm"
version = "0.5.0"
authors = ["IOTA Stiftung"]
edition = "2021"
Expand All @@ -20,16 +20,16 @@ async-trait = { version = "0.1", default-features = false }
console_error_panic_hook = { version = "0.1" }
futures = { version = "0.3" }
js-sys = { version = "0.3" }
proc-typescript = { version = "0.1.0", path = "./proc-typescript" }
proc_typescript = { version = "0.1.0", path = "./proc-typescript" }
cycraig marked this conversation as resolved.
Show resolved Hide resolved
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", default-features = false }
serde_repr = { version = "0.1", default-features = false }
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
wasm-bindgen-futures = { version = "0.4", default-features = false }

[dependencies.identity]
[dependencies.identity_iota]
version = "=0.5.0"
path = "../../identity"
path = "../../identity_iota"
default-features = false
features = ["account", "storage-test-suite", "unstable-encryption", "revocation-bitmap"]

Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/proc-typescript/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "proc-typescript"
name = "proc_typescript"
version = "0.1.0"
authors = ["IOTA Stiftung"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/identity/chain_state.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::ChainState;
use identity_iota::account_storage::ChainState;
use wasm_bindgen::prelude::*;

use crate::error::Result;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/storage/test_suite.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::StorageTestSuite;
use identity_iota::account_storage::StorageTestSuite;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use wasm_bindgen_futures::future_to_promise;
Expand Down
44 changes: 22 additions & 22 deletions bindings/wasm/src/account/storage/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
use core::fmt::Debug;
use core::fmt::Formatter;

use identity::account_storage::CekAlgorithm;
use identity::account_storage::ChainState;
use identity::account_storage::EncryptedData;
use identity::account_storage::EncryptionAlgorithm;
use identity::account_storage::Error as AccountStorageError;
use identity::account_storage::KeyLocation;
use identity::account_storage::Result as AccountStorageResult;
use identity::account_storage::Signature;
use identity::account_storage::Storage;
use identity::crypto::PrivateKey;
use identity::crypto::PublicKey;
use identity::iota_core::IotaDID;
use identity::iota_core::NetworkName;
use identity::prelude::IotaDocument;
use identity::prelude::KeyType;
use identity_iota::account_storage::CekAlgorithm;
use identity_iota::account_storage::ChainState;
use identity_iota::account_storage::EncryptedData;
use identity_iota::account_storage::EncryptionAlgorithm;
use identity_iota::account_storage::Error as AccountStorageError;
use identity_iota::account_storage::KeyLocation;
use identity_iota::account_storage::Result as AccountStorageResult;
use identity_iota::account_storage::Signature;
use identity_iota::account_storage::Storage;
use identity_iota::crypto::PrivateKey;
use identity_iota::crypto::PublicKey;
use identity_iota::iota_core::IotaDID;
use identity_iota::iota_core::NetworkName;
use identity_iota::prelude::IotaDocument;
use identity_iota::prelude::KeyType;
use js_sys::Array;
use js_sys::Promise;
use js_sys::Uint8Array;
Expand Down Expand Up @@ -367,9 +367,9 @@ interface Storage {
didCreate: (network: string, fragment: string, privateKey?: Uint8Array) => Promise<[DID, KeyLocation]>;

/** Removes the keys and any other state for the given `did`.

This operation is idempotent: it does not fail if the given `did` does not (or no longer) exist.

Returns `true` if the did and its associated data was removed, `false` if nothing was done. */
didPurge: (did: DID) => Promise<boolean>;

Expand All @@ -384,17 +384,17 @@ interface Storage {
keyGenerate: (did: DID, keyType: KeyType, fragment: string) => Promise<KeyLocation>;

/** Inserts a private key at the specified `location`.

If a key at `location` exists, it is overwritten. */
keyInsert: (did: DID, keyLocation: KeyLocation, privateKey: Uint8Array) => Promise<void>;

/** Retrieves the public key from `location`. */
keyPublic: (did: DID, keyLocation: KeyLocation) => Promise<Uint8Array>;

/** Deletes the key at `location`.

This operation is idempotent: it does not fail if the key does not exist.

Returns `true` if it removed the key, `false` if nothing was done. */
keyDelete: (did: DID, keyLocation: KeyLocation) => Promise<boolean>;

Expand All @@ -405,13 +405,13 @@ interface Storage {
keyExists: (did: DID, keyLocation: KeyLocation) => Promise<boolean>;

/** Encrypts the given `plaintext` with the specified `encryptionAlgorithm` and `cekAlgorithm`.
*
*
* Returns an `EncryptedData` instance.
*/
dataEncrypt: (did: DID, plaintext: Uint8Array, associatedData: Uint8Array, encryptionAlgorithm: EncryptionAlgorithm, cekAlgorithm: CekAlgorithm, publicKey: Uint8Array) => Promise<EncryptedData>;

/** Decrypts the given `data` with the specified `encryptionAlgorithm` and `cekAlgorithm`.
*
*
* Returns the decrypted text.
*/
dataDecrypt: (did: DID, data: EncryptedData, encryptionAlgorithm: EncryptionAlgorithm, cekAlgorithm: CekAlgorithm, privateKey: KeyLocation) => Promise<Uint8Array>;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/types/agreement_info.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::AgreementInfo;
use identity_iota::account_storage::AgreementInfo;
use serde::Deserialize;
use serde::Serialize;
use wasm_bindgen::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/types/auto_save.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account::AutoSave;
use identity_iota::account::AutoSave;
use wasm_bindgen::prelude::*;

use crate::error::Result;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/types/cek_algorithm.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::CekAlgorithm;
use identity_iota::account_storage::CekAlgorithm;
use serde::Deserialize;
use serde::Serialize;
use wasm_bindgen::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/types/encrypted_data.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::EncryptedData;
use identity_iota::account_storage::EncryptedData;
use wasm_bindgen::prelude::*;

use crate::error::Result;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/types/encryption_algorithm.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::EncryptionAlgorithm;
use identity_iota::account_storage::EncryptionAlgorithm;
use serde::Deserialize;
use serde::Serialize;
use wasm_bindgen::prelude::*;
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/src/account/types/identity_setup.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account::IdentitySetup;
use identity::crypto::PrivateKey;
use identity_iota::account::IdentitySetup;
use identity_iota::crypto::PrivateKey;
use wasm_bindgen::prelude::*;

#[wasm_bindgen]
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/types/key_location.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::KeyLocation;
use identity_iota::account_storage::KeyLocation;
use wasm_bindgen::prelude::*;

use crate::crypto::WasmKeyType;
Expand Down
6 changes: 3 additions & 3 deletions bindings/wasm/src/account/types/method_content.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account::MethodContent;
use identity::crypto::PrivateKey;
use identity::crypto::PublicKey;
use identity_iota::account::MethodContent;
use identity_iota::crypto::PrivateKey;
use identity_iota::crypto::PublicKey;
use serde::Deserialize;
use serde::Serialize;
use wasm_bindgen::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/account/types/signature.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity::account_storage::Signature;
use identity_iota::account_storage::Signature;
use wasm_bindgen::prelude::*;

use crate::error::Result;
Expand Down
32 changes: 16 additions & 16 deletions bindings/wasm/src/account/wasm_account/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ use std::cell::RefCell;
use std::rc::Rc;
use std::sync::Arc;

use identity::account::Account;
use identity::account::AccountBuilder;
use identity::account::PublishOptions;
use identity::account_storage::CekAlgorithm;
use identity::account_storage::EncryptedData;
use identity::account_storage::EncryptionAlgorithm;
use identity::account_storage::Storage;
use identity::core::OneOrMany;
use identity::credential::Credential;
use identity::credential::Presentation;
use identity::crypto::ProofOptions;
use identity::crypto::PublicKey;
use identity::did::verifiable::VerifiableProperties;
use identity::iota::Client;
use identity::iota_core::IotaDID;
use identity::iota_core::IotaDocument;
use identity_iota::account::Account;
use identity_iota::account::AccountBuilder;
use identity_iota::account::PublishOptions;
use identity_iota::account_storage::CekAlgorithm;
use identity_iota::account_storage::EncryptedData;
use identity_iota::account_storage::EncryptionAlgorithm;
use identity_iota::account_storage::Storage;
use identity_iota::client::Client;
use identity_iota::core::OneOrMany;
use identity_iota::credential::Credential;
use identity_iota::credential::Presentation;
use identity_iota::crypto::ProofOptions;
use identity_iota::crypto::PublicKey;
use identity_iota::did::verifiable::VerifiableProperties;
use identity_iota::iota_core::IotaDID;
use identity_iota::iota_core::IotaDocument;
use js_sys::Promise;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
Expand Down
10 changes: 5 additions & 5 deletions bindings/wasm/src/account/wasm_account/account_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
use std::cell::RefCell;
use std::rc::Rc;

use identity::account::AccountBuilder;
use identity::account::IdentitySetup;
use identity::iota::Client;
use identity::iota::ClientBuilder;
use identity::iota_core::IotaDID;
use identity_iota::account::AccountBuilder;
use identity_iota::account::IdentitySetup;
use identity_iota::client::Client;
use identity_iota::client::ClientBuilder;
use identity_iota::iota_core::IotaDID;
use js_sys::Promise;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
Expand Down
Loading