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

Upgrade to new Stronghold interface #787

Merged
merged 62 commits into from May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
fa34e24
Rename stronghold module
PhilippGackstatter Apr 1, 2022
06fa332
Postfix old stronghold with `_old`
PhilippGackstatter Apr 1, 2022
7ed19e0
Migrate to new stronghold interface
PhilippGackstatter Apr 1, 2022
76055e0
Impl did_create properly with client syncing
PhilippGackstatter Apr 1, 2022
29750e2
Add context to `StrongholdError`s
PhilippGackstatter Apr 1, 2022
3ede737
Add `Stronghold` wrapper test
PhilippGackstatter Apr 1, 2022
d019b58
Add `test_key_delete`
PhilippGackstatter Apr 2, 2022
8645f61
Add storage_test_suite setup & did_create test
PhilippGackstatter Apr 2, 2022
652dad5
Re-export test suite feature
PhilippGackstatter Apr 4, 2022
102458d
Expose test suite in Wasm
PhilippGackstatter Apr 4, 2022
42e61e3
Extend `did_create` test, fix index persistence
PhilippGackstatter Apr 4, 2022
a8428ab
Test `key_generate`
PhilippGackstatter Apr 4, 2022
1ea17cb
Move `key_delete` to test suite
PhilippGackstatter Apr 4, 2022
4d5a75e
Remove test suite from this branch
PhilippGackstatter Apr 4, 2022
fc04d25
Add initial test suite and expose to Wasm
PhilippGackstatter Apr 4, 2022
6e531bf
Merge branch 'feat/storage-test-suite' into feat/stronghold-interface…
PhilippGackstatter Apr 4, 2022
9575da0
rm `Error` postfix from `StrongholdError` variants
PhilippGackstatter Apr 4, 2022
5038efe
Remove duplicate `mod tests` in Wasm
PhilippGackstatter Apr 4, 2022
d64ba1a
Handle client sync error; document syncing
PhilippGackstatter Apr 5, 2022
a015adb
Use updated stronghold
PhilippGackstatter Apr 12, 2022
4f96b8a
Use dedicated `load_snapshot` function
PhilippGackstatter Apr 12, 2022
b7f149a
Purge client in `did_purge`
PhilippGackstatter Apr 12, 2022
5fb33af
Revert cfg_attr shenanigans
PhilippGackstatter Apr 12, 2022
8c0e5b1
Make `Stronghold::client` not async
PhilippGackstatter Apr 12, 2022
7feecb5
Remove asyncness from fns where not necessary
PhilippGackstatter Apr 12, 2022
ec432bb
Make `mutate_client` not async either
PhilippGackstatter Apr 12, 2022
394f69d
Merge branch 'dev' into feat/stronghold-interface-upgrade
PhilippGackstatter Apr 12, 2022
990cb6e
Move test_util mod where it belongs
PhilippGackstatter Apr 12, 2022
1ac23f7
Remove `source` errors from `Display` impl
PhilippGackstatter Apr 12, 2022
46dd21c
Remove `RecordHint` everywhere
PhilippGackstatter Apr 27, 2022
7ba2bb2
Use base crate `MemoryError`; remove engine dep
PhilippGackstatter May 3, 2022
77fe174
Revert temporary send/sync change
PhilippGackstatter May 3, 2022
13ca926
Document `Stronghold` wrapper
PhilippGackstatter May 3, 2022
f74fc25
Use same export style as other crates
PhilippGackstatter May 3, 2022
a354668
Create parent directories if they don't exist
PhilippGackstatter May 3, 2022
a54067c
Remove outdated TODO
PhilippGackstatter May 3, 2022
e862d74
Fix index writing in purge; update stronghold rev
PhilippGackstatter May 4, 2022
2f499b4
Remove old stronghold wrapper
PhilippGackstatter May 4, 2022
2f3c072
Reactivate multi identity example
PhilippGackstatter May 4, 2022
5773103
Merge branch 'dev' into feat/stronghold-interface-upgrade
PhilippGackstatter May 4, 2022
fffcf4e
Add `dropsave` getter/setter
PhilippGackstatter May 4, 2022
5cd10f5
Fully qualify `std::any::type_name`
PhilippGackstatter May 4, 2022
3aefe76
Remove tests which are already in test suite
PhilippGackstatter May 4, 2022
ae97b3e
Reactivate `Send`-assertion test
PhilippGackstatter May 4, 2022
e08dcac
Return `Stronghold` instance from test `storages`
PhilippGackstatter May 4, 2022
205bfc8
Test incorrect password returns error
PhilippGackstatter May 4, 2022
743fcf4
Use `OsRng` instead of `thread_rng`
PhilippGackstatter May 4, 2022
e9993b8
Bump stronghold revision
PhilippGackstatter May 4, 2022
0c8b201
Remove unused `getrandom` depenency
PhilippGackstatter May 4, 2022
098e5d5
Remove unused `actix` dependency
PhilippGackstatter May 4, 2022
8836245
Remove tokio `rt-multi-thread` feature
PhilippGackstatter May 4, 2022
5e09f39
Prefer `sample_string` over `sample_iter`
PhilippGackstatter May 4, 2022
89177e2
Enable `didPurge` test for NAPI stronghold
PhilippGackstatter May 5, 2022
2ad40c2
Simplify `did_create` by using `mutate_client`
PhilippGackstatter May 5, 2022
f7a7d5a
Rename doc/state client paths to store keys
PhilippGackstatter May 5, 2022
4e804a8
Add procedure_error fn to reduce err map code
PhilippGackstatter May 5, 2022
19a7f6e
Remove unnecessary clone
PhilippGackstatter May 5, 2022
560730c
Disable multiple identities example temporarily
PhilippGackstatter May 5, 2022
43ac834
Disable musl build
PhilippGackstatter May 5, 2022
784cdc8
Remove musl target from stronghold-nodejs
PhilippGackstatter May 5, 2022
2f12afd
use local workflow file
eike-hass May 5, 2022
a28e902
Revert "use local workflow file"
PhilippGackstatter May 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/shared-build-and-test-stronghold-nodejs.yml
Expand Up @@ -63,17 +63,18 @@ jobs:
npm run build && strip dist/*.node
test: |
npm run test
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
architecture: x64
setup: |
sudo apt-get install -y musl-tools
build: |
export NPM_BUILD_NAPI_ARGS=--target=x86_64-unknown-linux-musl
npm run build && strip dist/*.node
test-docker: |
docker build -f .github/Dockerfile.alpine -t tester .github
docker run --rm -v $(pwd):/build -w /build/bindings/stronghold-nodejs tester sh -c "ldd dist/identity-stronghold-nodejs.linux-x64-musl.node || true && npm run test:examples"
# TODO: Disabled until we have a fix for building Rust code for musl that includes rand::thread_rng.
# - host: ubuntu-latest
# target: x86_64-unknown-linux-musl
# architecture: x64
# setup: |
# sudo apt-get install -y musl-tools
# build: |
# export NPM_BUILD_NAPI_ARGS=--target=x86_64-unknown-linux-musl
# npm run build && strip dist/*.node
# test-docker: |
# docker build -f .github/Dockerfile.alpine -t tester .github
# docker run --rm -v $(pwd):/build -w /build/bindings/stronghold-nodejs tester sh -c "ldd dist/identity-stronghold-nodejs.linux-x64-musl.node || true && npm run test:examples"
- host: macos-latest
target: aarch64-apple-darwin
build: |
Expand Down
Expand Up @@ -4,6 +4,7 @@ import { stronghold } from '../stronghold';
// Only verifies that no uncaught exceptions are thrown, including syntax errors etc.
describe("Test Stronghold Node.js examples", function () {
it("Multiple Identities", async () => {
await multipleIdentities(await stronghold());
// TODO: Temporarily disabled until iotaledger/stronghold.rs#353 is fixed.
// await multipleIdentities(await stronghold());
});
})
Expand Up @@ -24,9 +24,7 @@ describe("Test Stronghold Node.js", function () {
it("keySignEd25519", async () => {
await StorageTestSuite.keySignEd25519Test(await stronghold());
});
// TODO: Deliberately exclude didPurge test because key deletion
// is not implemented properly in stronghold. Should be activated with #757.
// it("didPurge", async () => {
// await StorageTestSuite.didPurgeTest(await stronghold());
// });
it("didPurge", async () => {
await StorageTestSuite.didPurgeTest(await stronghold());
});
});
3 changes: 1 addition & 2 deletions bindings/stronghold-nodejs/package.json
Expand Up @@ -14,8 +14,7 @@
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl"
"x86_64-unknown-linux-gnu"
]
}
},
Expand Down
7 changes: 4 additions & 3 deletions examples/Cargo.toml
Expand Up @@ -34,9 +34,10 @@ path = "account/lazy.rs"
name = "account_signing"
path = "account/signing.rs"

[[example]]
name = "account_multiple"
path = "account/multiple_identities.rs"
# TODO: Temporarily disabled until iotaledger/stronghold.rs#353 is fixed.
# [[example]]
# name = "account_multiple"
# path = "account/multiple_identities.rs"

[[example]]
name = "account_unchecked"
Expand Down
16 changes: 4 additions & 12 deletions identity-account-storage/Cargo.toml
Expand Up @@ -11,7 +11,6 @@ repository = "https://github.com/iotaledger/identity.rs"
description = "Secure storage for Decentralized Identifiers and Verifiable Credentials."

[dependencies]
actix = { version = "0.12.0", optional = true }
anyhow = { version = "1.0", default-features = false, features = ["std"], optional = true }
async-trait = { version = "0.1", default-features = false }
function_name = { version = "0.2", default-features = false, optional = true }
Expand All @@ -27,22 +26,17 @@ seahash = { version = "4.1.0", default-features = false }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
strum = { version = "0.24.0", default-features = false, features = ["std", "derive"] }
thiserror = { version = "1.0" }
tokio = { version = "1.17.0", default-features = false, features = ["sync"], optional = true }
tokio = { version = "1.17.0", default-features = false, features = ["sync", "fs"], optional = true }
zeroize = { version = "1.4" }

[dependencies.iota-crypto]
version = "=0.9.1"
default-features = false
features = ["blake2b", "hmac", "pbkdf", "sha", "std"]
features = ["hmac", "pbkdf", "sha", "std"]

[dependencies.iota_stronghold]
git = "https://github.com/iotaledger/stronghold.rs"
rev = "969df405661ba4977f2cf30e9909cef7e30cefa2"
optional = true

[dependencies.stronghold_engine]
git = "https://github.com/iotaledger/stronghold.rs"
rev = "969df405661ba4977f2cf30e9909cef7e30cefa2"
rev = "629466da83a677925904b2e733ef7bfad5a42864"
optional = true

[dev-dependencies]
Expand All @@ -53,9 +47,7 @@ tokio = { version = "1.17.0", default-features = false, features = ["macros", "r
default = ["stronghold", "send-sync-storage", "storage-test-suite"]
stronghold = [
"iota_stronghold",
"stronghold_engine",
"actix",
"tokio/rt-multi-thread",
"tokio",
"futures",
"once_cell",
"rand",
Expand Down
4 changes: 2 additions & 2 deletions identity-account-storage/src/storage/mod.rs
Expand Up @@ -9,8 +9,8 @@ mod test_suite;
mod traits;

pub use self::memstore::*;
#[cfg(feature = "stronghold")]
pub use self::stronghold::*;
pub use self::traits::*;
#[cfg(feature = "stronghold")]
pub use crate::stronghold::Stronghold;
#[cfg(feature = "storage-test-suite")]
pub use test_suite::StorageTestSuite;