Plugins: Prevent passing host environment variables to plugin processes by default (#113412)

* remove pluginsSkipHostEnvVars toggle

* fix tests
This commit is contained in:
Will Browne
2025-11-13 15:31:57 +00:00
committed by GitHub
parent ae8a8cf16e
commit f041563df3
11 changed files with 188 additions and 212 deletions
@@ -137,11 +137,10 @@ func configureAppChildPlugin(parent *plugins.Plugin, child *plugins.Plugin) {
}
// SkipHostEnvVarsDecorateFunc returns a DecorateFunc that configures the SkipHostEnvVars field of the plugin.
// It will be set to true if the FlagPluginsSkipHostEnvVars feature flag is set, and the plugin is not present in the
// ForwardHostEnvVars plugin ids list.
// It will be set to true if the plugin is not present in the ForwardHostEnvVars plugin ids list.
func SkipHostEnvVarsDecorateFunc(cfg *config.PluginManagementCfg) DecorateFunc {
return func(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error) {
p.SkipHostEnvVars = cfg.Features.SkipHostEnvVarsEnabled && !slices.Contains(cfg.ForwardHostEnvVars, p.ID)
p.SkipHostEnvVars = !slices.Contains(cfg.ForwardHostEnvVars, p.ID)
return p, nil
}
}