fix: protect mobile LoadPlugins call's context - #259
Merged
Conversation
#251 added script-level smoke tests for the contrib plugins but they were never invoked by any Makefile target or GitHub workflow, only guarding regressions when run manually. Add plugin-test/contrib-test targets (root Makefile -> contrib/Makefile -> per-plugin Makefiles) that run each plugin's smoke_test.sh or go test, wire a new contrib-test CI job into main.yml, and document the smoke tests in contrib/README.md and CLAUDE.md. Signed-off-by: Date Huang <tjjh89017@hotmail.com>
mobile/controller.go's cycle() called manager.LoadPlugins(ctx, ...) with the bare ctx, while publish()/establish() already wrap their contexts via protectedContext() before touching plugin store paths. Wrap LoadPlugins' context the same way for consistency, and correct the adjacent comment: plugin factories (registry.Factory) don't currently thread ctx through, so this protects the LoadPlugins call boundary only -- Store.Get/Set (via publish/establish's storeCtx) remain the actual protected network path for plugins today. Signed-off-by: Date Huang <tjjh89017@hotmail.com>
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
mobile/controller.go'scycle()now wraps the context passed tomanager.LoadPlugins(...)withprotectedContext(ctx, c.node.protector), matching the existing pattern already used bypublish()/establish()for their store-access contexts.registry.Factory) don't currently threadctxthrough, so this protects theLoadPluginscall boundary only --Store.Get/Set(viapublish/establish'sstoreCtx) remain the actual protected network path for plugins today.Closes #254
Test plan
make mobile-testpassesgolangci-lint(mobile tags) clean