mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat: add suppport for bypassing the blocking behavior of malicious packages (#53)
* feat: add suppport for bypassing the blocking behavior of malicious packages * feat: add InsecureInstallation config to bypass malware scanning with tests * ui: introduce ShowWarning interaction method * guard test fix
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/safedep/dry/log"
|
||||
"github.com/safedep/pmg/cmd/npm"
|
||||
@@ -56,6 +57,13 @@ func main() {
|
||||
ui.SetVerbosityLevel(ui.VerbosityLevelVerbose)
|
||||
}
|
||||
|
||||
// Check for PMG_INSECURE_INSTALLATION environment variable
|
||||
if val := os.Getenv("PMG_INSECURE_INSTALLATION"); val != "" {
|
||||
if boolVal, err := strconv.ParseBool(val); err == nil {
|
||||
globalConfig.InsecureInstallation = boolVal
|
||||
}
|
||||
}
|
||||
|
||||
log.InitZapLogger("pmg", "cli")
|
||||
cmd.SetContext(globalConfig.Inject(cmd.Context()))
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user