summaryrefslogtreecommitdiff
path: root/path_static_roles.go
diff options
context:
space:
mode:
Diffstat (limited to 'path_static_roles.go')
-rw-r--r--path_static_roles.go9
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
}