chore(vetkeys): migrate password_manager_with_metadata to icp-cli and @icp-sdk/vetkeys#1353
Draft
marc0olo wants to merge 17 commits into
Draft
chore(vetkeys): migrate password_manager_with_metadata to icp-cli and @icp-sdk/vetkeys#1353marc0olo wants to merge 17 commits into
marc0olo wants to merge 17 commits into
Conversation
… @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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the
password_manager_with_metadatavetkeys example as part of #1343:dfx.jsonwithicp.yamlfor both Rust and Motoko backends@dfinity/vetkeys@0.3.0with@icp-sdk/vetkeys@0.5.0-beta.0@dfinity/*packages with@icp-sdk/auth@7.1.0/@icp-sdk/core@5.4.0ic-vetkeysto0.7.0withKeyManagerAPI updates inlib.rsic-vetkeysto0.5.0, adds[toolchain] moc = "1.5.1"tailwind.config.cjstotailwind.config.mjsvite.config.jsto useicpCLI for dev server config--yesflag tonpx @icp-sdk/bindgeningen_bindings.shto suppress install promptrust-vetkeys-{example}-{language}-{platform}to{language}-{example}-{platform}for clarityTest plan
npm installresolves without errors infrontend/icp network start -d && icp deploysucceeds fromrust/andmotoko/dirs@dfinity/vetkeysordfxreferences🤖 Generated with Claude Code