mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat: Add proxy_install_only config to restrict proxy to download commands
Introduces proxy_install_only (default: false) which, when enabled, skips the proxy for package manager commands that do not download packages (e.g. npm ls, pip list), avoiding unnecessary MITM overhead. - Add ProxyInstallOnly to Config and config template - Add IsKnownDownloadCommand / MayDownloadPackages to ParsedCommand - Add DownloadCommands to npm and pypi PM configs covering update, ci, audit, dlx, exec, x, download, run and equivalents per PM - Extract shared runner.Execute used by both proxy flow and guard - Proxy flow short-circuits to runner.Execute for non-download commands when proxy_install_only=true
This commit is contained in:
@@ -70,6 +70,11 @@ type Config struct {
|
||||
// we initially introduced it as an experimental feature.
|
||||
ExperimentalProxyMode bool `mapstructure:"experimental_proxy_mode"`
|
||||
|
||||
// ProxyInstallOnly restricts proxy interception to install commands only.
|
||||
// When false (default), proxy runs for all package manager commands.
|
||||
// When true, non-install commands (e.g., npm ls, pip list) bypass the proxy and execute directly.
|
||||
ProxyInstallOnly bool `mapstructure:"proxy_install_only"`
|
||||
|
||||
// Verbosity controls the UI verbosity level. Valid values: "silent", "normal", "verbose".
|
||||
Verbosity string `mapstructure:"verbosity"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user