Skip to content

feat: validate local RPC targets independently of transports - #5

Draft
irvinebroque wants to merge 2 commits into
mainfrom
codex/validate-local-target
Draft

feat: validate local RPC targets independently of transports#5
irvinebroque wants to merge 2 commits into
mainfrom
codex/validate-local-target

Conversation

@irvinebroque

@irvinebroque irvinebroque commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Validation currently attaches to a class decorator or a transport-specific response helper. That makes it awkward to take an existing object and expose only a chosen interface through another Cap'n Web transport.

validateTarget<PublicApi>(target) adds that missing step: validate the object first, then give it to the transport. It reuses the existing server wrapper to reject undeclared methods and invalid arguments, including on returned capabilities. The interface is inferred when no type argument is supplied.

The README and validation guide show usage and explain that native Workers RPC still needs @validateRpc(), because it requires branded objects rather than proxies. A minor changeset is included.

Validation: 617 Node and Workers tests, including a real MessagePort session, plus build, type checks, and Markdown lint pass.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Brendan Irvine-Broque seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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