summaryrefslogtreecommitdiff
path: root/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend.go')
-rw-r--r--backend.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/backend.go b/backend.go
index fd5a983..99ba886 100644
--- a/backend.go
+++ b/backend.go
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"strings"
+ "sync"
"git.tardisproject.uk/tcmal/vault-plugin-kerberos-secrets/client"
"github.com/hashicorp/vault/sdk/framework"
@@ -14,11 +15,13 @@ import (
type krbBackend struct {
*framework.Backend
client KerberosClient
+
+ rotationListLock *sync.Mutex
+ rotationList map[string]bool
}
type KerberosClient interface {
- SetPassword(username string, password string) error
- SetPasswordWithOld(username string, oldPassword, newPassword string) error
+ SetPassword(ctx context.Context, username string, password string) error
}
var _ logical.Factory = Factory
@@ -39,7 +42,10 @@ func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend,
}
func newBackend() *krbBackend {
- b := &krbBackend{}
+ b := &krbBackend{
+ rotationListLock: &sync.Mutex{},
+ rotationList: map[string]bool{},
+ }
b.Backend = &framework.Backend{
Help: strings.TrimSpace(mockHelp),
BackendType: logical.TypeLogical,