feat(ocap-kernel): add allowedWsHosts param to initializeRemoteComms#878
Merged
feat(ocap-kernel): add allowedWsHosts param to initializeRemoteComms#878
Conversation
Allow platform services to pass an allowedWsHosts list through the initializeRemoteComms RPC method to the remote comms options. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configure circuitRelayTransport with discoverRelays: 1 so the client actively seeks and maintains a relay reservation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ansport" This reverts commit 26ffdc6.
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
grypez
reviewed
Mar 17, 2026
Comment on lines
+74
to
+76
| if (params.allowedWsHosts !== undefined) { | ||
| options.allowedWsHosts = params.allowedWsHosts; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| if (params.allowedWsHosts !== undefined) { | |
| options.allowedWsHosts = params.allowedWsHosts; | |
| } | |
| const options = { relays, maxRetryAttempts, maxQueue, allowedWsHosts } = params; | |
| return await initializeRemoteComms( | |
| params.keySeed, | |
| ifDefined(options), |
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.
Summary
allowedWsHostsas an optional parameter to theinitializeRemoteCommsRPC method (struct, type, and handler)allowedWsHoststhrough toRemoteCommsOptionswhen providedTest plan
allowedWsHosts(accepts valid array, rejects non-array, rejects non-string elements, accepts empty array)allowedWsHoststo hookallowedWsHosts🤖 Generated with Claude Code
Note
Medium Risk
Extends a networking-related RPC surface to accept and pass through an
allowedWsHostsallowlist, which can affect what websocket targets are permitted. Risk is moderated by strict param validation and focused tests, but misconfiguration could broaden connectivity.Overview
Adds an optional
allowedWsHosts: string[]parameter to theinitializeRemoteCommsRPC method, validating it via superstruct and passing it through toRemoteCommsOptionsonly when provided.Updates/expands unit tests to cover
allowedWsHostsvalidation (accepts arrays including empty, rejects non-arrays and non-string elements) and to assert the handler forwards the option and omits it when undefined.Written by Cursor Bugbot for commit f99cce3. This will update automatically on new commits. Configure here.