Skip to content

feat: delegation permissions — release 0.48.0#734

Merged
lwshang merged 2 commits into
mainfrom
rk/delegation-permissions
Jul 5, 2026
Merged

feat: delegation permissions — release 0.48.0#734
lwshang merged 2 commits into
mainfrom
rk/delegation-permissions

Conversation

@raymondk

@raymondk raymondk commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What

Support the new permissions field on delegations, and cut release 0.48.0.

  • ic-transport-types: add permissions: Option<DelegationPermissions> to Delegation, plus a new DelegationPermissions enum (Queries | All) describing which request kinds a signed delegation authorizes. Serializes as "queries"/"all"; omitted when None.
  • ic-agent: re-export DelegationPermissions from ic_agent::identity alongside Delegation/SignedDelegation, so callers can name the type when setting the field without a direct ic-transport-types dependency.

Why

Requested by the Identity team — blocking the MCP read-only permissions feature. Matches the protocol addition in dfinity/ic#10449.

Release: 0.48.0 (minor bump)

Delegation is a public struct that is not #[non_exhaustive], so adding a field is a breaking change under SemVer (struct-literal construction now requires permissions: None). For a 0.x crate the breaking position is the minor version, so 0.47.3 → 0.48.0. The 0.48.0 number is free — the earlier 0.48.0 (rustls change, #732) was reverted before release and never published to crates.io.

Compatibility

permissions uses #[serde(default, skip_serializing_if = "Option::is_none")], so a None value is omitted from serialization and to_request_id produces the identical hash to a pre-permissions delegation. Existing signed delegations still verify unchanged; new/old wire formats deserialize interchangeably.

Changes for release

  • Workspace version 0.47.3 → 0.48.0 (Cargo.toml + Cargo.lock)
  • CHANGELOG.md ## [0.48.0] entry with a Breaking Changes note

Publish to crates.io via the manual Publish to crates.io workflow after merge.

@raymondk raymondk requested a review from a team as a code owner July 5, 2026 00:47
@zeropath-ai

zeropath-ai Bot commented Jul 5, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 835ca9c.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► ic-agent/src/identity/mod.rs
    pub use ic_transport_types::{Delegation, DelegationPermissions, SenderInfo, SignedDelegation}
Enhancement ► ic-transport-types/src/lib.rs
    pub struct Delegation {
     /// If present, this delegation only applies to the specified kinds of requests.
     #[serde(default, skip_serializing_if = "Option::is_none")]
     pub permissions: Option,
    }
    /// The kinds of requests a [Delegation] permits.
    #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Serialize, Deserialize)]
    pub enum DelegationPermissions {
     /// Only query calls and read_state requests are permitted.
     #[serde(rename = "queries")]
     Queries,
     /// All request types are permitted.
     #[serde(rename = "all")]
     All,
    }
Enhancement ► ref-tests/tests/integration.rs
    Add permissions: None fields to several delegation initializations and usages in integration tests

Bump workspace version 0.47.3 -> 0.48.0. Adding the `permissions` field
to the (non-exhaustive) public `Delegation` struct is a breaking change
under SemVer, which for a 0.x crate maps to a minor bump. Record the
change in CHANGELOG.md.

Also re-export `DelegationPermissions` from `ic_agent::identity` next to
`Delegation`/`SignedDelegation`, so downstreams can name the type when
setting the new field without adding a direct `ic-transport-types` dep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lwshang lwshang changed the title feat: support delegation permissions feat: delegation permissions — release 0.48.0 Jul 5, 2026
@lwshang lwshang enabled auto-merge (squash) July 5, 2026 01:41
@lwshang lwshang merged commit 7e8dc0e into main Jul 5, 2026
17 checks passed
@lwshang lwshang deleted the rk/delegation-permissions branch July 5, 2026 01: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.

2 participants