feat: add app name verification to all golang plugins

Moving verification of input to the earliest place is the best way to decrease the need to validate this further downstream.

Additionally, some of the existing checks were.... lacking :)
This commit is contained in:
Jose Diaz-Gonzalez
2020-12-25 00:00:26 -05:00
parent 382dc01b33
commit ffa303092f
8 changed files with 41 additions and 94 deletions

View File

@@ -142,6 +142,10 @@ func CommandReport(appName string, infoFlag string) error {
// CommandSet set or clear a network property for an app
func CommandSet(appName string, property string, value string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
if property == "bind-all-interfaces" && value == "" {
value = "false"
}