feat: Utility CLI to interact with the secrets service.
This commit is contained in:
1 parent
39ea9d708a
commit
f65e0c7eaa
7 files changed
+150
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package hmsecrets
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(getCmd)
|
||||
}
|
||||
|
||||
var getCmd = &cobra.Command{
|
||||
Use: "get",
|
||||
Short: "get [key]",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
cli := getClient(apiBase, caFile, clientCert, clientKey)
|
||||
secret, err := cli.GetString(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(secret)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user