Check newly inserted secrets with crunchy
@@ -6,6 +6,8 @@ import (
"io"
"os"
+ "github.com/fatih/color"
+ "github.com/muesli/crunchy"
"github.com/urfave/cli"
)
@@ -91,5 +93,10 @@ func (s *Action) Insert(c *cli.Context) error {
}
content = []byte(pw)
+ validator := crunchy.NewValidator()
+ if err := validator.Check(pw); err != nil {
+ fmt.Println(color.CyanString(fmt.Sprintf("Warning: %s", err)))
+ }
+
return s.Store.SetConfirm(name, content, "Inserted user supplied password", confirm)
}
