镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

test(mcp): cover renewal of a saved approval that includes create - #2654

Closed
wpfleger96 wants to merge 1 commit into
mainfrom
hayt/test-create-scope-renewal
Closed

wpfleger96 wants to merge 1 commit into
mainfrom
hayt/test-create-scope-renewal

Conversation

@wpfleger96

Copy link
Copy Markdown
Member

Follow-up to #2650, which allowed saved external app approvals to include create. That PR tested Approval::valid_scopes(), but nothing covered renewing a saved grant that includes create.

This adds one test in src-tauri/src/host_mcp/pairing.rs. It uses the real Grant serde, reserve_at and renew:

  • A saved grant with read, post and create survives a serde round trip (the same encoding save and load use) and renews with exactly the same scopes and a new expiry.
  • A renewal whose request has different scopes (a subset, create alone, or the same scopes in another order) is rejected, and the expiry stays the same.

Tests only. No production changes.

Checked: cargo test --lib host_mcp::pairing passes (11 tests). If the renewal check stops comparing scopes, the new test fails.

A saved grant with read, post and create survives a serde round trip and
renews with the same scopes. Renewal with different scopes is rejected.
@wpfleger96
wpfleger96 requested a review from a team as a code owner November 5, 2026 19:13
@wpfleger96 wpfleger96 closed this Nov 5, 2026
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