Expose principal-keyed gateway trust in the tool action surface - #194
Merged
Merged
Conversation
Moves gatewayTrust/gatewayUntrust/gatewayListTrusted into their own module as free functions over a narrow GatewayTrustStore slice, matching the same split-a-collaborator-out convention already used for agent-registry.ts, delivery-engine.ts, and friends. Pure move, no behavioural change: keeps tool.ts under the repo's max-lines cap ahead of extending these three actions with a principal flag.
Adds an optional principal field to the gateway_trust/gateway_untrust action schema and MCP tool params, and the matching addTrustedGatewayPrincipal/removeTrustedGatewayPrincipal/listTrustedGatewayPrincipals methods to MeshOnlyFeatures and MeshStore, wrapping GatewayTrust.addPrincipal/removePrincipal/listPrincipals (agent-comms#187). Nothing reads the flag yet; the action handlers are wired up next.
gatewayTrust/gatewayUntrust now check action.principal: when true, they call the principal-keyed store methods (addTrustedGatewayPrincipal/ removeTrustedGatewayPrincipal) instead of the bare-device ones, so the MCP tool layer can finally reach GatewayTrust's principal allowlist (agent-comms#187) alongside the original bare-device path. gatewayListTrusted now reports both the trusted devices and the trusted principals together, since listing isn't mutually exclusive the way trusting/untrusting is. Closes #193
Mearman
force-pushed
the
feat/gateway-trust-principal-tool-actions
branch
from
September 18, 2026 08:55
ff052c7 to
7406c3e
Compare
Mearman
marked this pull request as ready for review
September 18, 2026 08:58
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 3.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #193
Extends the existing
gateway_trust/gateway_untrustMCP tool actions with an optionalprincipalfield: when true, the given device-id is trusted/untrusted as a user principal (GatewayTrust.addPrincipal/removePrincipal, agent-comms#187) instead of a bare remote device.gateway_list_trustednow reports both the trusted devices and the trusted principals together, since listing isn't mutually exclusive the way trusting/untrusting is.Extended the existing three actions rather than adding new ones, matching the issue's own suggested naming convention.
Split
gatewayTrust/gatewayUntrust/gatewayListTrustedout oftool.tsinto their own module (gateway-trust-actions.ts) as a separate, behaviour-preserving refactor commit first, since the added lines pushedtool.tsover the repo'smax-linescap.