fix(kap-server): restrict debug RPC fallback to feature-contributed services - #2808
Open
sailist wants to merge 1 commit into
Open
fix(kap-server): restrict debug RPC fallback to feature-contributed services#2808sailist wants to merge 1 commit into
sailist wants to merge 1 commit into
Conversation
…ervices The decorator-registry fallback resolved every decorator name, including kernel tokens like instantiationService — a call to instantiationService/dispose would tear down the root container. Record Feature.contributeService tokens in a contributed-service table and fall back to that table only, so runtime-contributed services stay callable while unregistered kernel tokens remain unreachable.
|
commit: |
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.
Related Issue
Follow-up to #2806 (merged as 8603549), addressing its Codex review finding (P2) that landed after the merge.
Problem
#2806 added a decorator-name fallback to the
/api/v1/debugdispatcher so Feature-contributed services (which bypass the static scoped registry) remain callable. But the fallback resolved every decorator name, including kernel tokens that are seeded into each container yet were never registered as scoped services. Example:POST /api/v1/debug/instantiationService/disposeresolves the root container through the fallback and reflectively callsdispose()on it, tearing down the running server.What changed
features/featureRegistry.tsgains a contributed-service table (recordContributedService/getContributedServices, deduped by scope + token);Feature.contributeServicerecords every contribution there.channelRegistry.resolveAnyScopedServiceId) now consults only that table instead of the global decorator registry: the reachable surface beyond the static registry is exactly "services a Feature explicitly contributed"; kernel tokens such asinstantiationServicestay unreachable. The now-unneededlookupServiceDecoratorexport is removed.instantiationService/disposeis rejected with 40001, and a feature-assembly assertion thatIDebugEventsServicelands in the contributed-service table.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.