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

WASM Keytool Signer #1515

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
8fa2d1c
add wip state for identity client
wulfraem Jan 27, 2025
8c314c9
signer: support keys other than ed25519
UMR1352 Jan 28, 2025
bcfd3af
remove unused dependency
UMR1352 Jan 28, 2025
1a588d4
fix failing doc test
UMR1352 Jan 29, 2025
8885db3
dprint
UMR1352 Jan 29, 2025
6e010ca
StorageSigner receives TxData instead of raw bytes
UMR1352 Jan 29, 2025
74a3c00
Use IotaSignature as Signer output, let signer handle all signing logic
UMR1352 Jan 29, 2025
f17718c
Keytool signer
UMR1352 Jan 28, 2025
1449c33
Keytool signer
UMR1352 Jan 29, 2025
93202d9
Keytool signer tests
UMR1352 Jan 29, 2025
ff3b3ae
fmt
UMR1352 Jan 29, 2025
326cf71
re-export KeytoolSigner
UMR1352 Jan 29, 2025
27f0d99
KeytoolSignerBuilder
UMR1352 Jan 30, 2025
d76b712
WASM KeytoolSigner
UMR1352 Feb 3, 2025
05d6491
fmt
UMR1352 Feb 3, 2025
4403473
buildable wasm
UMR1352 Feb 3, 2025
ee335dc
Make WasmKeytoolSigner work
UMR1352 Feb 4, 2025
e717391
ensures WASM keytool signer implements Signer TS interface
UMR1352 Feb 5, 2025
bf91fa6
add signing and exection for exampe 0 (create did)
wulfraem Feb 5, 2025
6cd3c40
fix smaller TODOs and unwraps
wulfraem Feb 5, 2025
c5b952f
add update did example impl
wulfraem Feb 6, 2025
6e23af1
add example to deactivate a did
wulfraem Feb 7, 2025
e5f751e
apply review suggestions - remove unused code from -1 example
wulfraem Feb 7, 2025
7634aab
update IOTA sdk dependency to `@iota/iota.js`
wulfraem Feb 7, 2025
b965dc2
Apply suggestions from code review
wulfraem Feb 7, 2025
4ee56ba
Apply suggestions from code review
wulfraem Feb 7, 2025
5ad547e
apply review suggestion
wulfraem Feb 7, 2025
8f8c8cc
apply review suggestions
wulfraem Feb 7, 2025
6c23d94
apply reivew suggestions
wulfraem Feb 7, 2025
e30c980
remove unused error variant
wulfraem Feb 10, 2025
84c92fc
add helper function for Uint8 array to pt bcs conversion
wulfraem Feb 11, 2025
dfe8d41
add comment and formatting
wulfraem Feb 11, 2025
aa6c35b
StorageSigner (#1523)
UMR1352 Feb 11, 2025
634d5be
Remove any mention of "Kinesis" from identity_wasm (#1524)
UMR1352 Feb 11, 2025
d679051
Re-add Resolver API for WASM builds (#1526)
wulfraem Feb 19, 2025
bc9c441
Update and re-enable WASM examples (#1528)
wulfraem Feb 19, 2025
f7ffc94
WASM Proposals (#1529)
UMR1352 Feb 19, 2025
a23dbeb
Merge branch 'feat/wasm32-identity-client' into feat/keytool-signer-wasm
UMR1352 Feb 20, 2025
86468ed
Add waiting for transaction block availability to TS variant of `exec…
wulfraem Feb 20, 2025
b329aa9
Fix document consuming in WASM when publishing updates (#1541)
wulfraem Feb 20, 2025
ba0f4b7
Reenable Wasm tests (#1536)
eike-hass Feb 21, 2025
fe9c5cc
update how DIDs are fetched from created identity (#1542)
wulfraem Feb 21, 2025
512cb6b
Remove stardust artifacts (#1543)
eike-hass Feb 21, 2025
2ee5e5a
wasm keytoolsigner
UMR1352 Feb 21, 2025
4ead237
Fix format issues (#1544)
wulfraem Feb 21, 2025
5a53009
Merge remote-tracking branch 'origin/feat/identity-rebased-alpha' int…
wulfraem Feb 21, 2025
eabf83c
fix custom key handler in example
wulfraem Feb 21, 2025
bec19aa
fix serialization/deserialization of Signature
UMR1352 Feb 21, 2025
ac8a290
update exampel to use new API flow
wulfraem Feb 21, 2025
75f10ab
bump min engine version
eike-hass Feb 21, 2025
711bfd0
temp commit
UMR1352 Feb 25, 2025
d3703c1
update to latest version of bindgen
UMR1352 Feb 25, 2025
6a9178b
update storage singer to use Uint8Array for public key internally
wulfraem Feb 25, 2025
d74b28c
cleanup
UMR1352 Feb 25, 2025
0fad370
Merge branch 'feat/wasm32-identity-client' into feat/keytool-signer-wasm
UMR1352 Feb 25, 2025
5644551
make KeytoolSigner work with keytool version 0.8.1
UMR1352 Feb 25, 2025
3c3d51f
update CI to use wasm-bindgen version 0.2.100
UMR1352 Feb 25, 2025
a2e4ac0
use node 20 in CI
UMR1352 Feb 26, 2025
da69e6d
dprint fmt
UMR1352 Feb 26, 2025
bc50f40
use latest toolchain for identity_wasm
UMR1352 Feb 26, 2025
cb0aa9f
add missing licence header
UMR1352 Feb 26, 2025
430285b
use node 20 in all CI actions
UMR1352 Feb 26, 2025
7a3edf4
avoid fauceting if address already has enough funds
UMR1352 Feb 26, 2025
8596284
use binding/wasm/target to store WASM compilation artifacts
UMR1352 Feb 26, 2025
67725ca
Update bindings/wasm/iota_interaction_ts/Cargo.toml
UMR1352 Feb 26, 2025
e913586
avoid casting to any
UMR1352 Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/publish/publish-wasm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Download bindings/wasm artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/release/bump-versions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ runs:
uses: actions/setup-node@v2
if: ${{inputs.release-target == 'wasm'}}
with:
node-version: '16.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Bump Wasm npm package version
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/rust/rust-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ runs:
rustup show
- name: Cache cargo
uses: actions/cache@v2.1.7
uses: actions/cache@v4
if: inputs.cargo-cache-enabled == 'true'
with:
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
Expand All @@ -115,7 +115,7 @@ runs:
shell: bash

- name: Cache build target
uses: actions/cache@v2.1.7
uses: actions/cache@v4
if: inputs.target-cache-enabled == 'true'
with:
path: ${{ inputs.target-cache-path }}
Expand All @@ -127,7 +127,7 @@ runs:
${{ inputs.os }}-target-
- name: Cache sccache
uses: actions/cache@v2.1.7
uses: actions/cache@v4
if: inputs.sccache-enabled == 'true'
with:
path: ${{ inputs.sccache-path }}
Expand Down
5 changes: 3 additions & 2 deletions .github/actions/rust/sccache/setup-sccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ runs:
brew update --auto-update
brew install sccache
- name: Install sccache (ubuntu-24.04)
if: inputs.os == 'ubuntu-24.04'
- name: Install sccache (ubuntu)
if: ${{ startsWith(inputs.os, 'ubuntu-') }}
shell: bash
run: |
SCCACHE_DOWNLOAD_LINK=https://github.com/mozilla/sccache/releases/download
Expand All @@ -42,5 +42,6 @@ runs:
- name: Start sccache
shell: bash
run: |
echo "starting sccache on ${{ inputs.os }}"
sccache --start-server
sccache -s
49 changes: 31 additions & 18 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'support/**'
paths:
- '.github/workflows/build-and-test.yml'
- '.github/workflows/shared-build-wasm.yml'
- '.github/actions/**'
- '**.rs'
- '**.toml'
Expand Down Expand Up @@ -140,16 +141,13 @@ jobs:
# publish the package and set the IOTA_IDENTITY_PKG_ID env variable
run: |
iota move test
working-directory: ./identity_iota_core/packages/iota_identity
working-directory: identity_iota_core/packages/iota_identity

- name: publish IotaIdentity package
if: matrix.os != 'windows-latest'
# publish the package and set the IOTA_IDENTITY_PKG_ID env variable
run: |
json_output=$(iota client publish --skip-dependency-verification --with-unpublished-dependencies --json --gas-budget 500000000 .)
package_id=$(echo $json_output | jq --raw-output '.objectChanges[] | select(.type | contains("published")) | .packageId')
echo "IOTA_IDENTITY_PKG_ID=$package_id" >> "$GITHUB_ENV"
working-directory: ./identity_iota_core/packages/iota_identity
run: echo "IOTA_IDENTITY_PKG_ID=$(./publish_identity_package.sh)" >> "$GITHUB_ENV"
working-directory: identity_iota_core/scripts/

- name: Run tests excluding `custom_time` feature
if: matrix.os != 'windows-latest'
Expand Down Expand Up @@ -183,11 +181,10 @@ jobs:

build-wasm:
needs: check-for-run-condition
# if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
if: ${{ false }} # disable for now, as the wasm bindings are not yet ready
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@main
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
uses: './.github/workflows/shared-build-wasm.yml'
with:
run-unit-tests: false
output-artifact-name: identity-wasm-bindings-build

test-wasm:
Expand All @@ -207,7 +204,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x

- name: Install JS dependencies
run: npm ci
Expand All @@ -217,18 +214,33 @@ jobs:
uses: actions/download-artifact@v4
with:
name: identity-wasm-bindings-build
path: bindings/wasm/identity_wasm
path: bindings/wasm/

- name: Start iota sandbox
uses: './.github/actions/iota-rebase-sandbox/setup'

- name: publish IotaIdentity package
if: matrix.os != 'windows-latest'
# publish the package and set the IOTA_IDENTITY_PKG_ID env variable
run: echo "IOTA_IDENTITY_PKG_ID=$(./publish_identity_package.sh)" >> "$GITHUB_ENV"
working-directory: identity_iota_core/scripts/

- name: Install JS dependencies
run: npm ci
working-directory: bindings/wasm/identity_wasm

- name: Install JS dependencies # This is problematic: @iota/iota-sdk seems to not get used from the identity_wasm package, that is why reinstall deps here
run: npm ci
working-directory: bindings/wasm/iota_interaction_ts

- name: Run Wasm examples
run: npm run test:readme && npm run test:node
working-directory: bindings/wasm/identity_wasm

test-wasm-firefox:
needs: build-wasm
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
# if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
if: ${{ false }} # disable for now
runs-on: ubuntu-24.04
strategy:
fail-fast: false
Expand All @@ -243,7 +255,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x

- name: Install JS dependencies
run: npm ci
Expand All @@ -253,7 +265,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: identity-wasm-bindings-build
path: bindings/wasm/identity_wasm
path: bindings/wasm/

- name: Start iota sandbox
uses: './.github/actions/iota-rebase-sandbox/setup'
Expand All @@ -272,7 +284,8 @@ jobs:

test-wasm-chrome:
needs: build-wasm
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
# if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
if: ${{ false }} # disable for now
runs-on: ubuntu-24.04
strategy:
fail-fast: false
Expand All @@ -287,7 +300,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x

- name: Install JS dependencies
run: npm ci
Expand All @@ -297,7 +310,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: identity-wasm-bindings-build
path: bindings/wasm/identity_wasm
path: bindings/wasm/

- name: Start iota sandbox
uses: './.github/actions/iota-rebase-sandbox/setup'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
# Download a pre-compiled wasm-bindgen binary.
- name: Install wasm-bindgen-cli
uses: jetli/wasm-bindgen-action@24ba6f9fff570246106ac3f80f35185600c3f6c9
with:
version: '0.2.93'

- name: core clippy check
uses: actions-rs-plus/clippy-check@b09a9c37c9df7db8b1a5d52e8fe8e0b6e3d574c4
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/rust-automatic-release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ on:
jobs:
call-create-release-workflow:
if: github.event.pull_request.merged == true
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-release.yml@main
uses: './.github/workflows/shared-release.yml'
with:
changelog-config-path: ./.github/.github_changelog_generator
pre-release-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+-(?<pre_release>\w+)\.\d+$
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/rust-create-hotfix-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:

jobs:
create-hotfix-pr:
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-hotfix-pr.yml@main
uses: './.github/workflows/shared-create-hotfix-pr.yml'
with:
branch: ${{ github.event.inputs.branch }}
branch-regex: ^support\/v[0-9]+\.[0-9]+$
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/rust-create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ on:
jobs:
create-dev-release-pr:
if: github.event.inputs.release-type != 'main'
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-dev-release-pr.yml@main
uses: './.github/workflows/shared-create-dev-release-pr.yml'
with:
tag-prefix: v
tag-postfix: -${{ github.event.inputs.release-type }}.
Expand All @@ -34,8 +33,7 @@ jobs:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
create-main-release-pr:
if: github.event.inputs.release-type == 'main'
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-main-release-pr.yml@main
uses: './.github/workflows/shared-create-main-release-pr.yml'
with:
tag-prefix: v
tag-base: ${{ github.event.inputs.version }}
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/shared-build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
build-wasm:
defaults:
run:
working-directory: bindings/wasm/identity_wasm
working-directory: bindings/wasm/
shell: bash
runs-on: ubuntu-latest
strategy:
Expand All @@ -46,15 +46,18 @@ jobs:
with:
os: ${{ runner.os }}
job: ${{ github.job }}
target: wasm32-unknown-unknown
cargo-cache-enabled: true
target-cache-enabled: true
sccache-enabled: true
sccache-path: ${{ matrix.sccache-path }}
target-cache-path: bindings/wasm/identity_wasm/target
target-cache-path: bindings/wasm/target

# Download a pre-compiled wasm-bindgen binary.
- name: Install wasm-bindgen-cli
uses: jetli/wasm-bindgen-action@24ba6f9fff570246106ac3f80f35185600c3f6c9
with:
version: '0.2.100'

- name: Setup sccache
uses: './.github/actions/rust/sccache/setup-sccache'
Expand All @@ -64,17 +67,28 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x

- name: Install JS dependencies
run: npm ci
working-directory: bindings/wasm/iota_interaction_ts

- name: Build IOTA interaction bindings
run: npm run build
working-directory: bindings/wasm/iota_interaction_ts

- name: Install JS dependencies
run: npm ci
working-directory: bindings/wasm/identity_wasm

- name: Build WASM bindings
run: npm run build
working-directory: bindings/wasm/identity_wasm

- name: Run Node unit tests
if: ${{ inputs.run-unit-tests }}
run: npm run test:unit:node
working-directory: bindings/wasm/identity_wasm

- name: Stop sccache
uses: './.github/actions/rust/sccache/stop-sccache'
Expand All @@ -90,5 +104,7 @@ jobs:
bindings/wasm/identity_wasm/web
bindings/wasm/identity_wasm/examples/dist
bindings/wasm/identity_wasm/docs
bindings/wasm/iota_interaction_ts/node
bindings/wasm/iota_interaction_ts/web
if-no-files-found: error
retention-days: 1
3 changes: 1 addition & 2 deletions .github/workflows/upload-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ permissions:

jobs:
build-wasm:
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@main
uses: './.github/workflows/shared-build-wasm.yml'
with:
run-unit-tests: false
ref: ${{ inputs.ref }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/wasm-automatic-release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ on:
jobs:
call-create-release-workflow:
if: github.event.pull_request.merged == true
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-release.yml@main
uses: './.github/workflows/shared-release.yml'
with:
changelog-config-path: ./bindings/wasm/identity_wasm/.github_changelog_generator
pre-release-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+-(?<pre_release>\w+)\.\d+$
Expand All @@ -25,9 +24,9 @@ jobs:
build-wasm:
needs: call-create-release-workflow
if: ${{ needs.call-create-release-workflow.outputs.is-release }}
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@main
uses: './.github/workflows/shared-build-wasm.yml'
with:
run-unit-tests: false
output-artifact-name: identity-wasm-bindings-build

release-wasm:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/wasm-create-hotfix-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:

jobs:
create-hotfix-pr:
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-hotfix-pr.yml@main
uses: './.github/workflows/shared-create-hotfix-pr.yml'
with:
branch: ${{ github.event.inputs.branch }}
branch-regex: ^support\/wasm-v[0-9]+\.[0-9]+$
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/wasm-create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ on:
jobs:
create-dev-release-pr:
if: github.event.inputs.release-type != 'main'
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-dev-release-pr.yml@main
uses: './.github/workflows/shared-create-dev-release-pr.yml'
with:
tag-prefix: wasm-v
tag-postfix: -${{ github.event.inputs.release-type }}.
Expand All @@ -37,8 +36,7 @@ jobs:

create-main-release-pr:
if: github.event.inputs.release-type == 'main'
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-main-release-pr.yml@main
uses: './.github/workflows/shared-create-main-release-pr.yml'
with:
tag-prefix: wasm-v
tag-base: ${{ github.event.inputs.version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wasm-publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ on:
jobs:

build-wasm:
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@main
uses: './.github/workflows/shared-build-wasm.yml'
with:
run-unit-tests: false
ref: ${{ github.event.inputs.branch }}
output-artifact-name: identity-wasm-bindings-build

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ result_large_err = "allow"

[profile.release.package.iota_interaction_ts]
opt-level = 's'
# Enabling debug for profile.release may lead to more helpfull loged call stacks.
# Enabling debug for profile.release may lead to more helpful logged call stacks.
# TODO: Clarify if 'debug = true' facilitates error analysis via console logs.
# If not, remove the next line
# If yes, describe the helping effect in the comment above
Expand Down
Loading
Loading