Skip to content

chore(vetkeys): migrate password_manager to icp-cli and @icp-sdk/vetkeys#1351

Open
marc0olo wants to merge 23 commits into
masterfrom
chore/vetkeys-password-manager-migration
Open

chore(vetkeys): migrate password_manager to icp-cli and @icp-sdk/vetkeys#1351
marc0olo wants to merge 23 commits into
masterfrom
chore/vetkeys-password-manager-migration

Conversation

@marc0olo
Copy link
Copy Markdown
Member

@marc0olo marc0olo commented May 29, 2026

Summary

Migrates the password_manager vetkeys example as part of #1343:

  • Replaces dfx.json with icp.yaml for Rust backend; updates existing motoko/backend/icp.yaml (removes --enhanced-orthogonal-persistence)
  • 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, Motoko ic-vetkeys to 0.5.0
  • Bumps Motoko toolchain to moc = "1.9.0" and migrates from base to core = "2.5.0"; upgrades ic-vetkeys from 0.4.0 to 0.5.0 in motoko/backend/mops.toml
  • Renames tailwind.config.cjstailwind.config.mjs (required by "type": "module")
  • Updates vite.config.ts to use icp CLI for dev server config
  • Adds dev:rust / dev:motoko npm scripts
  • Uses vetkeys-{example}.yml workflow naming (consistent with hello_world.yml / who_am_i.yml convention); jobs named {language}-{example}
  • Adds CI workflow (vetkeys-{example}.yml) using icp-dev-env container images on Ubuntu
  • Drops icp.ninja support, comments out icp.ninja badges in README

Test plan

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

🤖 Generated with Claude Code

marc0olo and others added 23 commits May 29, 2026 12:24
- Replace dfx.json with icp.yaml (Rust and Motoko backends)
- Update existing motoko/backend/icp.yaml (remove --enhanced-orthogonal-persistence)
- 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
- 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>
….1.0 API

- 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>
The motoko/backend/icp.yaml runs from motoko/backend/ but referenced
'frontend' directly. The shared frontend is at ../../frontend relative
to that location.

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…work-launcher)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace provision scripts + macOS + Linux dual-platform setup with
single Ubuntu job using icp-dev-env Docker images:
- ghcr.io/dfinity/icp-dev-env-rust:0.1.0 for Rust backends
- ghcr.io/dfinity/icp-dev-env-motoko:0.1.0 for Motoko backends

Eliminates: provision-darwin/linux.sh, pre-download-launcher.sh,
actions/setup-node, cargo install candid-extractor, ICP_CLI_GITHUB_TOKEN,
and macOS runners. Consistent with hello_world and who_am_i examples.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Follows hello_world/who_am_i naming (no language prefix, no -example
suffix), keeping vetkeys- namespace prefix for grouping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Workflow name: vetkeys-{example} (no rust- prefix)
Job IDs: rust and motoko (example name not needed in job context)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The icp-dev-env container downloads the network launcher from GitHub
on first run. Without authentication this hits the 60 req/hr
unauthenticated API limit. Pass GITHUB_TOKEN so downloads use the
authenticated 5000 req/hr limit.

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

Workaround for dfinity/icp-js-auth#120

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

getIdentity() is async in @icp-sdk/auth@7.1.0. Store the principal in
the auth state at authentication time and use $auth.principal in all
components instead of calling getIdentity().getPrincipal() directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ENCRYPTED_MAPS is a heap thread_local that resets to None after a
canister upgrade (init is not called on upgrade, only post_upgrade).
Store the key_name in a StableCell (persists across upgrades) and add
a post_upgrade hook that reinitializes ENCRYPTED_MAPS from it — same
pattern used in basic_ibe and basic_timelock_ibe backends.

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

StableCell::init() and set() in ic-stable-structures 0.6.8 return
values directly, not Result — .expect() does not apply.

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

- Move icp.yaml from motoko/backend/ to motoko/ (consistent with all
  other examples where icp deploy runs from the language root folder)
- Update main: path to backend/src/Main.mo
- Update frontend build path from ../../frontend to frontend (symlink)
- Remove motoko/backend/mops.toml (redundant — motoko/mops.toml is used)
- Update CI workflow working-directory: motoko/backend → motoko
- Update README deploy instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename domain separator strings and disclaimer text. Requires
--mode reinstall on next deploy (changing domain separator changes
key derivation, so old encrypted data would be inaccessible anyway).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo marked this pull request as ready for review June 3, 2026 13:50
@marc0olo marc0olo requested a review from a team as a code owner June 3, 2026 13:50
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