@@ -16,12 +16,14 @@ import (
1616 "strings"
1717 "sync"
1818
19+ "github.com/Keyfactor/keyfactor-go-client-sdk/v24"
1920 "github.com/hashicorp/vault/sdk/framework"
2021 "github.com/hashicorp/vault/sdk/logical"
2122)
2223
2324const (
2425 operationPrefixKeyfactor string = "keyfactor"
26+ PluginVersion = "1.4.2" // this should match the release version of the plugin
2527)
2628
2729// Factory configures and returns backend
@@ -39,7 +41,7 @@ type keyfactorBackend struct {
3941 * framework.Backend
4042 configLock sync.RWMutex
4143 cachedConfig * keyfactorConfig
42- client * keyfactorClient
44+ client * keyfactor. APIClient
4345}
4446
4547// keyfactorBackend defines the target API keyfactorBackend
@@ -67,6 +69,7 @@ func backend() *keyfactorBackend {
6769 BackendType : logical .TypeLogical ,
6870 Invalidate : b .invalidate ,
6971 InitializeFunc : b .Initialize ,
72+ RunningVersion : "v" + PluginVersion ,
7073 }
7174 return & b
7275}
@@ -100,13 +103,12 @@ func (b *keyfactorBackend) invalidate(ctx context.Context, key string) {
100103
101104// getClient locks the backend as it configures and creates a
102105// a new client for the target API
103- func (b * keyfactorBackend ) getClient (ctx context.Context , s logical.Storage ) (* keyfactorClient , error ) {
106+ func (b * keyfactorBackend ) getClient (ctx context.Context , s logical.Storage ) (* keyfactor. APIClient , error ) {
104107 b .configLock .RLock ()
105108 defer b .configLock .RUnlock ()
106109
107110 if b .client != nil {
108- b .Logger ().Debug ("closing idle connections before returning existing client" )
109- b .client .httpClient .CloseIdleConnections ()
111+ b .Logger ().Trace ("returning existing client" )
110112 return b .client , nil
111113 }
112114
@@ -127,5 +129,5 @@ func (b *keyfactorBackend) getClient(ctx context.Context, s logical.Storage) (*k
127129}
128130
129131const keyfactorHelp = `
130- The Keyfactor backend is a pki service that issues and manages certificates.
132+ The Keyfactor backend is a pki service that issues and manages certificates via the Keyfactor Command platform .
131133`
0 commit comments