diff --git a/cmd/getndf.go b/cmd/getndf.go index c40ba2c19c99897e7bb211d5ef61ed105d1802f4..e794fb4d38b6f3d7e0ca82b2b3a2576afef0d6d6 100644 --- a/cmd/getndf.go +++ b/cmd/getndf.go @@ -41,7 +41,7 @@ var getNDFCmd = &cobra.Command{ Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { gwHost := viper.GetString("gwhost") - //permHost := viper.GetString("permhost") + permHost := viper.GetString("permhost") certPath := viper.GetString("cert") // Load the certificate @@ -79,22 +79,22 @@ var getNDFCmd = &cobra.Command{ fmt.Printf("%s", resp.PartialNDF.Ndf) return } - // fixme: RequestNdf is no longer exposed to client. This block may need to be removed - //if permHost != "" { - // host, _ := connect.NewHost(&id.Permissioning, permHost, - // cert, params) - // pollMsg := &pb.NDFHash{ - // Hash: []byte("DummyUserRequest"), - // } - // resp, err := comms.RequestNdf(host, pollMsg) - // if err != nil { - // jww.FATAL.Panicf("Unable to ask %s for NDF:"+ - // " %+v", - // permHost, err) - // } - // fmt.Printf("%s", resp.Ndf) - // return - //} + + if permHost != "" { + host, _ := connect.NewHost(&id.Permissioning, permHost, + cert, params) + pollMsg := &pb.NDFHash{ + Hash: []byte("DummyUserRequest"), + } + resp, err := comms.RequestNdf(host, pollMsg) + if err != nil { + jww.FATAL.Panicf("Unable to ask %s for NDF:"+ + " %+v", + permHost, err) + } + fmt.Printf("%s", resp.Ndf) + return + } fmt.Println("Enter --gwhost or --permhost and --cert please") },