Skip to content

feat!: require @icp-sdk/core v6, and act for read-only sessions - #192

Merged
sea-snake merged 2 commits into
mainfrom
chore/icp-sdk-core-v6
Sep 16, 2026
Merged

sea-snake merged 2 commits into
mainfrom
chore/icp-sdk-core-v6

Conversation

@sea-snake

@sea-snake sea-snake commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Moves the peer dependency to @icp-sdk/core v6, takes @icp-sdk/signer v6 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 v6

The 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, and toCborValue() emits it.

appDelegationChain threw 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.

SessionUnsupportedError is untouched — it is the general AppDelegationSource outcome, not tied to this refusal.

The scope is set where the session is issued: permissions is an opt text the 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.md covers the peer-dependency move and what it unlocks, following the v8 and v9 guides in shape and sidebar.order.

Verification

pnpm build, pnpm typecheck and pnpm test all pass — 360 tests, no type errors, publint --strict clean. 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 on main.

The new permissions assertion was checked against its own regression: dropping the constructor argument fails carries the permissions of a read-only session and leaves the rest of the suite green.

Core v6's other changes do not reach this package — readState is unused here, and the imported surface is limited to agent, candid, identity and principal.

🤖 Generated with Claude Code

@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>
Copilot AI lite review requested due to automatic review settings September 16, 2026 14:45
@sea-snake
sea-snake requested a review from a team as a code owner September 16, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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
sea-snake force-pushed the chore/icp-sdk-core-v6 branch from d4082e2 to 30375b0 Compare September 16, 2026 14:55
@sea-snake
sea-snake merged commit 11c1a1e into main Sep 16, 2026
10 checks passed
@sea-snake
sea-snake deleted the chore/icp-sdk-core-v6 branch September 16, 2026 14:58
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.

3 participants