Skip to content

chore(vetkeys): migrate password_manager_with_metadata to icp-cli and @icp-sdk/vetkeys#1353

Draft
marc0olo wants to merge 17 commits into
masterfrom
chore/vetkeys-password-manager-with-metadata-migration
Draft

chore(vetkeys): migrate password_manager_with_metadata to icp-cli and @icp-sdk/vetkeys#1353
marc0olo wants to merge 17 commits into
masterfrom
chore/vetkeys-password-manager-with-metadata-migration

Conversation

@marc0olo
Copy link
Copy Markdown
Member

@marc0olo marc0olo commented May 29, 2026

Summary

Migrates the password_manager_with_metadata vetkeys example as part of #1343:

  • Replaces dfx.json with icp.yaml for both Rust and Motoko backends
  • Replaces @dfinity/vetkeys@0.3.0 with @icp-sdk/vetkeys@0.5.0-beta.0
  • Replaces @dfinity/* packages with @icp-sdk/auth@7.1.0 / @icp-sdk/core@5.4.0
  • Bumps Rust ic-vetkeys to 0.7.0 with KeyManager API updates in lib.rs
  • Bumps Motoko ic-vetkeys to 0.5.0, adds [toolchain] moc = "1.5.1"
  • Renames tailwind.config.cjs to tailwind.config.mjs
  • Updates vite.config.js to use icp CLI for dev server config
  • Adds --yes flag to npx @icp-sdk/bindgen in gen_bindings.sh to suppress install prompt
  • Renames CI job keys from rust-vetkeys-{example}-{language}-{platform} to {language}-{example}-{platform} for clarity
  • Adds CI workflow for both Rust and Motoko backends on Darwin and Linux
  • Drops icp.ninja support, comments out icp.ninja badges in README

Test plan

  • CI workflow passes for both Rust and Motoko backends on Darwin and Linux
  • npm install resolves without errors in frontend/
  • icp network start -d && icp deploy succeeds from rust/ and motoko/ dirs
  • Rust backend compiles successfully with ic-vetkeys 0.7.0 API changes
  • No remaining @dfinity/vetkeys or dfx references

🤖 Generated with Claude Code

marc0olo and others added 17 commits May 29, 2026 12:25
… @icp-sdk/vetkeys

- Replace dfx.json with icp.yaml (Rust and Motoko backends)
- Use @icp-sdk/vetkeys@0.5.0-beta.0 instead of @dfinity/vetkeys
- Use @icp-sdk/auth@7.1.0 and @icp-sdk/core@5.4.0
- Update Motoko ic-vetkeys to 0.5.0, Rust ic-vetkeys to 0.7.0
- Apply KeyManager API changes for ic-vetkeys 0.7.0 in Rust backend
- Add moc 1.5.1 toolchain to mops.toml
- Rename tailwind.config.cjs to tailwind.config.mjs
- Add CI workflow for both Rust and Motoko backends
- Drop icp.ninja support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…icp-sdk/auth@7.1.0

- Remove rust-toolchain channel pin and profile
- Bump ic-cdk to 0.20.1 and add ic-cdk-management-canister 0.1.1
- Update ic_cdk::management_canister imports to ic_cdk_management_canister
- Update AuthClient: constructor, signIn/signOut, async getIdentity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ructures

- Format isLocalEnv assignment and identityProvider ternary to fit
  printWidth 80 (required by vite-plugin-eslint + prettier-recommended)
- Remove async from login() — no direct await in outer function
- Bump ic-stable-structures to 0.7.2 to match ic-vetkeys 0.7.0 dep

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getIdentity() is now async and returns Promise<Identity>. Calling
.getPrincipal() directly on the Promise triggers no-unsafe-call.
Add await for the inline call and use .then() for the setInterval
callback where async/await isn't directly usable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onents

Reactive statements ($:) are synchronous so cannot use await directly.
Use void .then() to resolve the Identity before calling getPrincipal().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getIdentity() is async. Fixed all remaining call sites:
- EditPassword.svelte: async functions use await; reactive block uses .then()
- SharingEditor.svelte: async functions use await (replace_all)
- NewPassword.svelte: reactive initializer + async function use await
- SidebarLayout.svelte: template uses principalText reactive variable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ame CI jobs

Add principal: Principal to AuthState "initialized" so all components
can access it synchronously — eliminating async getIdentity().then()
patterns inside Svelte reactive blocks that triggered infinite-reactive-loop.

Also rename CI job keys: remove rust-vetkeys- prefix so Motoko jobs
no longer misleadingly start with "rust".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…st format

Job keys now follow {language}-{example}-{platform} convention:
- rust-password-manager-with-metadata-{darwin,linux}
- motoko-password-manager-with-metadata-{darwin,linux}

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…intWidth 80

refreshVaults(auth.principal, auth.passwordManager) fits on one line;
move .catch callback to the next line per prettier's formatting rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rintWidth 80

refreshVaults(principal, passwordManager) fits on one line (70 chars)
so prettier collapses it. Move .catch callback to the next line.
Applied to EditPassword, SharingEditor, and NewPassword components.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…th 80

For untyped (e) => callbacks with short enough lines, prettier places
the arrow on the same line as .catch( rather than on the next line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sword

$: reactive declaration conflicts with bind:value two-way binding
(svelte/no-reactive-reassign). Use let initialization with $auth.principal
which is available synchronously now that principal is in auth state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change test_key_1 → key_1 in all icp.yaml: icp-cli 0.2.7 only
  provisions vetkd:Bls12_381_G2:key_1 (TestThresholdKeys subnet with
  test_key_1 is not yet supported by icp-cli). The vetkeys library
  itself uses key_1 in its own icp.yaml files.
- Add --yes flag to npx @icp-sdk/bindgen to suppress the install
  confirmation prompt during local builds
- basic_ibe: wrap event listeners in try-catch so errors are caught
  and shown (not silent unhandled rejections); add console.error()
  alongside alert() so errors are visible and copyable in DevTools

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…vetkeys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Folder Structure section explaining rust/, motoko/, frontend/ layout
  and why backends are in subdirectories (shared frontend via symlinks)
- Replace vague "from the X folder" wording with explicit `cd X` commands
- Fix `npm run dev` → `npm run dev:rust` / `npm run dev:motoko` (bare
  `dev` script intentionally errors with a "specify a backend" message)
- Add `cd frontend` before all dev commands (package.json is in frontend/,
  not at the example root)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d.ai

- rootKey: pass rootKey: canisterEnv?.IC_ROOT_KEY directly; undefined is
  fine when on mainnet (HttpAgent ignores it)
- identityProvider local: use /authorize path instead of /#authorize hash
- identityProvider production: use https://id.ai instead of undefined

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant