summaryrefslogtreecommitdiff
path: root/backend.go
diff options
context:
space:
mode:
authorAria <me@aria.rip>2023-10-01 22:55:08 +0100
committerAria <me@aria.rip>2023-10-01 22:55:08 +0100
commit7045a630996e08c18beb7c3d39e1b2752c8a4ba4 (patch)
treee539793ccb588433f44cc0e1b52821cb6953a85a /backend.go
parentca56d194c605ef7ba09f46eff11374b492f83804 (diff)
a working version with only changing passwords
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,