Skip to content

[Node] Set requestPermission False If Using Default Permission Handler#1056

Open
MRayermannMSFT wants to merge 3 commits intomainfrom
mrayermannmsft/dontsendifnotusing
Open

[Node] Set requestPermission False If Using Default Permission Handler#1056
MRayermannMSFT wants to merge 3 commits intomainfrom
mrayermannmsft/dontsendifnotusing

Conversation

@MRayermannMSFT
Copy link
Copy Markdown
Contributor

Needed for extensions security work. We want to detect if an extension is trying to setup a permission handler.

@MRayermannMSFT MRayermannMSFT requested a review from a team as a code owner April 10, 2026 00:07
Copilot AI review requested due to automatic review settings April 10, 2026 00:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts Node.js SDK session-resume behavior so extensions that don’t explicitly install a permission handler can be detected by the CLI/security layer, by sending requestPermission: false when the default join-session handler is used.

Changes:

  • Introduces a shared defaultJoinSessionPermissionHandler in types.ts for extension session joining.
  • Updates joinSession() to use the shared default permission handler instead of a local definition.
  • Changes session.resume RPC params to set requestPermission based on whether a real permission handler was provided.
Show a summary per file
File Description
nodejs/src/types.ts Adds shared default permission handler used as the sentinel for “no explicit handler.”
nodejs/src/extension.ts Switches joinSession() to use the shared default handler (removes local handler).
nodejs/src/client.ts Sets requestPermission to false when the default join-session handler is in use.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

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