diff options
author | Aria <me@aria.rip> | 2023-10-01 22:55:08 +0100 |
---|---|---|
committer | Aria <me@aria.rip> | 2023-10-01 22:55:08 +0100 |
commit | 7045a630996e08c18beb7c3d39e1b2752c8a4ba4 (patch) | |
tree | e539793ccb588433f44cc0e1b52821cb6953a85a /backend.go | |
parent | ca56d194c605ef7ba09f46eff11374b492f83804 (diff) |
a working version with only changing passwords
Diffstat (limited to 'backend.go')
-rw-r--r-- | backend.go | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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, |