feat: Utility CLI to interact with the secrets service.

This commit is contained in:
jmug committed 2026-10-24 02:13:11 -07:00
1 parent 39ea9d708a
commit f65e0c7eaa
7 files changed
+150

No files matched your search

+59
View File
@@ -0,0 +1,59 @@
package hmsecrets
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var apiBase string
var caFile string
var clientCert string
var clientKey string
func init() {
rootCmd.PersistentFlags().StringVar(
&apiBase,
"api-base",
"",
"base url for the service",
)
rootCmd.MarkPersistentFlagRequired("api-base")
rootCmd.PersistentFlags().StringVar(
&caFile,
"ca-file",
"",
"CA cert file",
)
rootCmd.MarkPersistentFlagRequired("ca-file")
rootCmd.PersistentFlags().StringVar(
&clientCert,
"client-cert",
"",
"certificate to be used for client mTLS auth",
)
rootCmd.MarkPersistentFlagRequired("client-cert")
rootCmd.PersistentFlags().StringVar(
&clientKey,
"client-key",
"",
"private key for the certificate to be used for client mTLS auth",
)
rootCmd.MarkPersistentFlagRequired("client-key")
}
var rootCmd = &cobra.Command{
Use: "hmsecrets",
Short: "Interact with the HandMade secrets service",
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}