Make backends much more consistent:

1) Use the new LeaseExtend
2) Use default values controlled by mount tuning/system defaults instead
of a random hard coded value
3) Remove grace periods
This commit is contained in:
Jeff Mitchell
2016-01-29 17:44:09 -05:00
parent c4c170555a
commit 2eb08d3bde
23 changed files with 120 additions and 99 deletions

View File

@@ -138,9 +138,8 @@ func (b *backend) pathLogin(
},
DisplayName: *user.Login,
LeaseOptions: logical.LeaseOptions{
TTL: ttl,
GracePeriod: ttl / 10,
Renewable: ttl > 0,
TTL: ttl,
Renewable: true,
},
},
}, nil
@@ -152,5 +151,5 @@ func (b *backend) pathLoginRenew(
if err != nil {
return nil, err
}
return framework.LeaseExtend(config.MaxTTL, 0, false)(req, d)
return framework.LeaseExtend(config.TTL, config.MaxTTL, b.System())(req, d)
}