-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(ipc): authenticate cross-session inbox connections with per-session tokens #10636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
87f8ae7
feat(ipc): authenticate cross-session inbox connections with per-sess…
qqqys 415d2d6
Merge branch 'main' into feat/peer-messaging-inbox-auth
qwen-code-dev-bot 0d99377
fix(ipc): scrub an inherited inbox address and token before spawning …
qqqys 2c2f66f
fix(cli): scrub the inherited messaging pair at the bootstrap boundary
qqqys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2026 Qwen | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /** | ||
| * The environment contract between a session and the processes it spawns. | ||
| * | ||
| * Kept in its own leaf module — no core imports — so the startup path can | ||
| * scrub an inherited pair before anything is spawned without paying for the | ||
| * messaging stack it would otherwise pull in. | ||
| */ | ||
|
|
||
| /** | ||
| * Where child processes of this session find its inbox, so a script or | ||
| * hook it runs can inject a message back into it (through the same | ||
| * inbound gate as any peer). Cleared when the inbox closes. | ||
| */ | ||
| export const MESSAGING_SOCKET_ENV = 'QWEN_CODE_MESSAGING_SOCKET'; | ||
| export const MESSAGING_TOKEN_ENV = 'QWEN_CODE_MESSAGING_TOKEN'; | ||
|
|
||
| /** | ||
| * Drop an inherited address/token pair. | ||
| * | ||
| * These two variables name one capability: the address a child connects to | ||
| * and the token that authenticates it there. A process that inherits them | ||
| * from an ancestor session but binds no inbox of its own would otherwise | ||
| * pass the ancestor's capability straight down to its own children — a hook | ||
| * following the documented injection pattern would then authenticate to the | ||
| * ancestor's inbox and, under the default policy, land its message in the | ||
| * wrong session's context while reporting success. | ||
| * | ||
| * Called once at startup, before anything is spawned. A session that does | ||
| * bind its own inbox re-exports its own pair on the success path | ||
| * ({@link PeerMessaging.start}), so the scrub only ever removes a pair this | ||
| * process has no right to hand on. | ||
| */ | ||
| export function clearInheritedPeerMessagingEnv(): void { | ||
| delete process.env[MESSAGING_SOCKET_ENV]; | ||
| delete process.env[MESSAGING_TOKEN_ENV]; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.