Skip to content

AUS-1003: Refuse reserved method names in SMDServiceCollection - #164

Open
Astn wants to merge 1 commit into
aus-1002-remove-inprocessclientfrom
aus-1003-reserved-names
Open

Astn wants to merge 1 commit into
aus-1002-remove-inprocessclientfrom
aus-1003-reserved-names

Conversation

@Astn

@Astn Astn commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Second of the ten 2.0.0 pull requests sequenced in AUS-1001 (https://linear.app/austins-test/issue/AUS-1001). Ticket: https://linear.app/austins-test/issue/AUS-1003. Stacked on #163; retarget to master once that merges.

  • SMDServiceCollection refuses names beginning with rpc. (ordinal) and the name $/cancelRequest in Add, the indexer setter and AddBatch (checked under the lock before any entry is copied, so a batch with one reserved name adds nothing). Null names keep their ArgumentNullException.
  • Every registration path reaches that check: BindMethod, the attribute binder and Handler.RegisterFuction through AddService, BindInterface through AddBatch. BindInterface drops its own rpc. test.
  • Internal AddReserved for the library's later rpc.discover registration: bypasses only the reserved check, still throws on a duplicate. Unused in 2.0.0.
  • ReservedNameTests (9 tests) cover each path, the accepted look-alikes ($/progress, rpcx, Rpc.x, x.rpc.y, $/cancelrequest, rpc), names compared as given, the batch invariant and AddReserved.
  • README "Defining methods" sentence, CHANGELOG 2.0.0 Changed bullet, docs/upgrading.md bullet.

Verification on the branch: Release build 0 warnings / 0 errors; 1200 tests pass on net8.0 and net10.0; check_request_path_sync.py 23 listed uses, none unlisted; render.py --check agrees. Registration is not on the request path, so no benchmark run.

Names beginning with rpc. and the name $/cancelRequest are refused by one check in SMDServiceCollection (Add, the indexer setter and AddBatch before any entry is copied), which every registration path reaches: BindMethod, the attribute binder and RegisterFuction through AddService, BindInterface through AddBatch. BindInterface drops its own rpc. test. An internal AddReserved keeps the duplicate rule for the library's later rpc.discover registration. README, CHANGELOG and docs/upgrading.md carry the change.

This branch has not been deployed

No deployments
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