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 /path_static_roles.go | |
parent | ca56d194c605ef7ba09f46eff11374b492f83804 (diff) |
a working version with only changing passwords
Diffstat (limited to 'path_static_roles.go')
-rw-r--r-- | path_static_roles.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/path_static_roles.go b/path_static_roles.go index a9b3ee9..c4bf094 100644 --- a/path_static_roles.go +++ b/path_static_roles.go @@ -108,12 +108,13 @@ func (b *krbBackend) pathRolesRead(ctx context.Context, req *logical.Request, d // pathRolesWrite makes a request to Vault storage to update a role based on the attributes passed to the role configuration func (b *krbBackend) pathRolesWrite(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) { - name, ok := d.GetOk("name") + rawName, ok := d.GetOk("name") if !ok { return logical.ErrorResponse("missing role name"), nil } + name := rawName.(string) - roleEntry, err := b.getRole(ctx, req.Storage, name.(string)) + roleEntry, err := b.getRole(ctx, req.Storage, name) if err != nil { return nil, err } @@ -132,10 +133,12 @@ func (b *krbBackend) pathRolesWrite(ctx context.Context, req *logical.Request, d roleEntry.LastVaultRotation = time.Unix(0, 0) - if err := setRole(ctx, req.Storage, name.(string), roleEntry); err != nil { + if err := setRole(ctx, req.Storage, name, roleEntry); err != nil { return nil, err } + b.backgroundRotation(name, req.Storage) + return nil, nil } |