Added small validation to GUNs, changed logrus loglevel

This commit is contained in:
Diogo Monica 2015-06-17 22:06:37 -07:00
parent e5dd1721b3
commit b0df67acd3
2 changed files with 5 additions and 2 deletions

View File

@ -162,8 +162,11 @@ func keysGenerate(cmd *cobra.Command, args []string) {
fatalf("must specify a GUN")
}
// (diogo): Validate GUNs
//TODO (diogo): Validate GUNs. Don't allow '/' or '\' for now.
gun := args[0]
if gun[0:1] == "/" || gun[0:1] == "\\" {
fatalf("invalid Global Unique Name: %s", gun)
}
_, cert, err := generateKeyAndCert(gun)
if err != nil {

View File

@ -26,7 +26,7 @@ const tufDir string = configPath + "tuf/"
var caStore trustmanager.X509Store
func init() {
logrus.SetLevel(logrus.DebugLevel)
logrus.SetLevel(logrus.ErrorLevel)
// Retrieve current user to get home directory
usr, err := user.Current()
if err != nil {