feat!: require @icp-sdk/core v6, and act for read-only sessions - #192
Merged
Merged
Conversation
@icp-sdk/core v6 wires the permissions field through `Delegation`, and @icp-sdk/signer v6 is the release that peer-depends on it, so both move together: the peer range becomes `^6`, and the signer dependency `^6.0.0`. With somewhere to put them, the one-hop chain an app signs with is assembled with the permissions the canister signed. A session the canister scoped to queries was refused for want of a field to carry them; it is now acted for like any other. BREAKING CHANGE: `@icp-sdk/auth` now requires `@icp-sdk/core` v6. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review comments remain, and the changes are covered by tests.
Pull request overview
Updates ICP SDK Core and Signer dependencies to v6 and enables read-only sessions by preserving delegation permissions.
Changes:
- Bumps SDK dependencies and lockfile entries to v6.
- Propagates permissions into app delegation chains.
- Adds coverage for scoped and unscoped sessions.
File summaries
| File | Description |
|---|---|
tests/client/session-minter.test.ts |
Tests permission propagation. |
src/client/session-minter.ts |
Carries permissions into app delegations. |
pnpm-lock.yaml |
Resolves the v6 dependency tree. |
package.json |
Updates dependency and peer ranges. |
Review details
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
- Files reviewed: 3/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Two changes to carry: the peer dependency moves to v6, and the error a read-only session raised is gone now that core supports those delegations. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sea-snake
force-pushed
the
chore/icp-sdk-core-v6
branch
from
September 16, 2026 14:55
d4082e2 to
30375b0
Compare
MRmarioruci
approved these changes
Sep 16, 2026
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.
What
Moves the peer dependency to
@icp-sdk/corev6, takes@icp-sdk/signerv6 along with it, and stops refusing read-only sessions.@icp-sdk/core: peer range^5→^6, dev dependency^5.4.0→^6.1.0@icp-sdk/signer:^5.6.2→^6.0.0, the release that peer-depends on core v6The two move together on purpose. Signer v6 is the first release to peer-depend on core
^6, so bumping core alone would leave a signer in the tree that declares core^5.Read-only sessions
Core v6 wires the permissions field through
Delegation(icp-js-core#1366): the constructor takes it, andtoCborValue()emits it.appDelegationChainthrew for any delegation the canister had scoped, because the chain type had nowhere to carry the permissions and sending one without them would fail verification at the boundary node. With the field wired through, the chain is assembled with the permissions the canister signed, and a session scoped to queries is acted for like any other.The test that asserted the refusal now asserts the permissions are carried, alongside one pinning the unscoped case to
undefined.SessionUnsupportedErroris untouched — it is the generalAppDelegationSourceoutcome, not tied to this refusal.The scope is set where the session is issued:
permissionsis anopt textthe canister returns, and there is no sign-in option here that asks for it, so this adds no API surface.Upgrading guide
docs/src/content/docs/upgrading/v10.mdcovers the peer-dependency move and what it unlocks, following the v8 and v9 guides in shape andsidebar.order.Verification
pnpm build,pnpm typecheckandpnpm testall pass — 360 tests, no type errors,publint --strictclean. No peer warnings in the installed tree. The docs build reports 0 errors, and its 5 warnings are the pre-existing typedoc cross-link ones onmain.The new permissions assertion was checked against its own regression: dropping the constructor argument fails
carries the permissions of a read-only sessionand leaves the rest of the suite green.Core v6's other changes do not reach this package —
readStateis unused here, and the imported surface is limited toagent,candid,identityandprincipal.🤖 Generated with Claude Code