summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/vault-plugin-kerberos-secrets/main.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/vault-plugin-kerberos-secrets/main.go b/cmd/vault-plugin-kerberos-secrets/main.go
new file mode 100644
index 0000000..59396c0
--- /dev/null
+++ b/cmd/vault-plugin-kerberos-secrets/main.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "os"
+
+ krb "git.tardisproject.uk/tcmal/vault-plugin-kerberos-secrets"
+ "github.com/hashicorp/go-hclog"
+ "github.com/hashicorp/vault/api"
+ "github.com/hashicorp/vault/sdk/plugin"
+)
+
+func main() {
+ apiClientMeta := &api.PluginAPIClientMeta{}
+ flags := apiClientMeta.FlagSet()
+ flags.Parse(os.Args[1:])
+
+ tlsConfig := apiClientMeta.GetTLSConfig()
+ tlsProviderFunc := api.VaultPluginTLSProvider(tlsConfig)
+
+ err := plugin.Serve(&plugin.ServeOpts{
+ BackendFactoryFunc: krb.Factory,
+ TLSProviderFunc: tlsProviderFunc,
+ })
+ if err != nil {
+ logger := hclog.New(&hclog.LoggerOptions{})
+
+ logger.Error("plugin shutting down", "error", err)
+ os.Exit(1)
+ }
+}